Skip to content

Commit c327018

Browse files
committed
feat: remove duplicates from contributors
1 parent 9f21432 commit c327018

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ecosystem/plugin-git/src/node/utils/getContributors.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,13 @@ export const getContributors = async (
2323
email,
2424
commits: Number.parseInt(commits, 10),
2525
}))
26+
.filter((item, index, self) => {
27+
// If one of the contributors is a "noreply" github address, and there's
28+
// already a contributor with the same name, it is very likely a duplicate,
29+
// so it can be removed.
30+
if (!item.email.endsWith('@users.noreply.github.com')) {
31+
return true
32+
}
33+
return index === self.findIndex((t) => t.name === item.name)
34+
})
2635
}

0 commit comments

Comments
 (0)