Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ecosystem/plugin-git/src/node/utils/getContributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,19 @@ export const getContributors = async (
email,
commits: Number.parseInt(commits, 10),
}))
.filter((item, index, self) => {
// If one of the contributors is a "noreply" email address, and there's
// already a contributor with the same name, it is very likely a duplicate,
// so it can be removed.
if (item.email.split('@')[1]?.match(/no-?reply/)) {
const realIndex = self.findIndex((t) => t.name === item.name)
if (realIndex !== index) {
// Update the "real" contributor to also include the noreply's commits
self[realIndex].commits += item.commits
return false
}
return true
}
return true
})
}