blacklist bots from contrib counters

This commit is contained in:
tree🌴 2024-01-31 01:56:05 +01:00
parent 24875fd8da
commit 2884a56045
2 changed files with 7 additions and 22 deletions

View file

@ -419,27 +419,6 @@
"site_admin": false, "site_admin": false,
"contributions": 2 "contributions": 2
}, },
{
"login": "dependabot[bot]",
"id": 49699333,
"node_id": "MDM6Qm90NDk2OTkzMzM=",
"avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/dependabot%5Bbot%5D",
"html_url": "https://github.com/apps/dependabot",
"followers_url": "https://api.github.com/users/dependabot%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/dependabot%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/dependabot%5Bbot%5D/gists{/gist_id}",
"starred_url": "https://api.github.com/users/dependabot%5Bbot%5D/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dependabot%5Bbot%5D/subscriptions",
"organizations_url": "https://api.github.com/users/dependabot%5Bbot%5D/orgs",
"repos_url": "https://api.github.com/users/dependabot%5Bbot%5D/repos",
"events_url": "https://api.github.com/users/dependabot%5Bbot%5D/events{/privacy}",
"received_events_url": "https://api.github.com/users/dependabot%5Bbot%5D/received_events",
"type": "Bot",
"site_admin": false,
"contributions": 1
},
{ {
"login": "kleinpetr", "login": "kleinpetr",
"id": 17269309, "id": 17269309,

View file

@ -25,6 +25,12 @@ const contributorRepos = [
] ]
function isBlacklisted (login) {
if (login.match(/\[bot\]$/)) {
return true;
}
}
async function getContributors () { async function getContributors () {
const output = []; const output = [];
for (const cr of contributorRepos) { for (const cr of contributorRepos) {
@ -35,7 +41,7 @@ async function getContributors () {
}); });
const arr = await response.json(); const arr = await response.json();
for (const item of arr) { for (const item of arr) {
if (item.login === "github-actions[bot]") { if (isBlacklisted(item.login)) {
continue; continue;
} }