diff --git a/ecosystem/plugin-git/src/node/utils/getContributors.ts b/ecosystem/plugin-git/src/node/utils/getContributors.ts index f2571bf4f4..bb37d9e393 100644 --- a/ecosystem/plugin-git/src/node/utils/getContributors.ts +++ b/ecosystem/plugin-git/src/node/utils/getContributors.ts @@ -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 + }) }