Now read from Commit.Committer, Committer & Author

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2025-08-23 09:52:14 +02:00
parent af4046d234
commit 862cf3659c
+27 -10
View File
@@ -39,24 +39,41 @@ func Commits(s github_recon_settings.Settings) (response CommitsResult) {
break
}
for _, item := range result.Commits {
name := item.Commit.GetAuthor().GetName()
email := item.Commit.GetAuthor().GetEmail()
if utils.SkipResult(name, email) {
emails := []string{
item.Commit.GetAuthor().GetEmail(),
item.Commit.GetCommitter().GetEmail(),
item.GetAuthor().GetEmail(),
item.GetCommitter().GetEmail(),
}
names := []string{
item.Commit.GetAuthor().GetName(),
item.Commit.GetCommitter().GetName(),
item.GetAuthor().GetName(),
item.GetCommitter().GetName(),
}
for i := range names {
if utils.SkipResult(names[i], emails[i]) {
continue
}
if _, seen := results[name+" - "+email]; !seen {
if names[i] == "" || emails[i] == "" {
continue
}
if _, seen := results[names[i]+" - "+emails[i]]; !seen {
author := CommitResult{
Name: name,
Email: email,
Name: names[i],
Email: emails[i],
Occurrences: 1,
FirstFoundIn: item.GetRepository().Owner.GetLogin() + "/" + item.GetRepository().
GetName(),
}
results[name+" - "+email] = author
} else {
result := results[name+" - "+email]
results[names[i]+" - "+emails[i]] = author
} else if i == 0 {
result := results[names[i]+" - "+emails[i]]
result.Occurrences++
results[name+" - "+email] = result
results[names[i]+" - "+emails[i]] = result
}
}
}
}