Skip to content

Commit bbe0f92

Browse files
authored
Bot user should not show as contributor (#565)
Filter bot users out of contributors list
1 parent 7d68e00 commit bbe0f92

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

scripts/get_contributors.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,18 @@ module.exports = async function (filepath) {
8989
})
9090
})
9191

92+
// Dedupe users
9293
return Object.values(
9394
[...authors, ...reviewers].reduce((accumulator, user) => {
94-
// Dedupe users
95-
// Some user objects do not have a URL (can't figure out why).
96-
// In that case, copy over a good URL instead.
97-
const newUser = accumulator[user.name] || user
98-
newUser.url = newUser.url || user.url
99-
accumulator[user.name] = newUser
95+
// Skip bot users
96+
if (!user.name.includes('[bot]')) {
97+
// Some user objects do not have a URL (can't figure out why).
98+
// In that case, copy over a good URL instead.
99+
const newUser = accumulator[user.name] || user
100+
newUser.url = newUser.url || user.url
101+
102+
accumulator[user.name] = newUser
103+
}
100104

101105
return accumulator
102106
}, {})

0 commit comments

Comments
 (0)