Skip to content

Commit

Permalink
Ignore non human users as contributor
Browse files Browse the repository at this point in the history
  • Loading branch information
simeg committed Dec 19, 2020
1 parent 63193b1 commit 2f394a7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/generate_contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,19 @@ const validateUsername = contributor => {
return !username.includes("<script");
};

// Ignore users that are not human, such as bots
const ignoreNonHumanUsers = contributor => {
const username = contributor.login;
const nonHumanUsernames = ["dependabot[bot]"];

return !nonHumanUsernames.includes(username);
};

const parseContributors = contributors => {
return contributors
.flatMap(c => c)
.filter(validateUsername)
.filter(ignoreNonHumanUsers)
.map(c => `- [${c.login}](${c.html_url})`)
.join('\n');
};
Expand Down

0 comments on commit 2f394a7

Please sign in to comment.