From 2884a5604543ba42c998acef6bffd722d72f7eb6 Mon Sep 17 00:00:00 2001 From: tree Date: Wed, 31 Jan 2024 01:56:05 +0100 Subject: [PATCH] blacklist bots from contrib counters --- src/contributors.json | 21 --------------------- utils/contributors.js | 8 +++++++- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/contributors.json b/src/contributors.json index a5ef589..53aa124 100644 --- a/src/contributors.json +++ b/src/contributors.json @@ -419,27 +419,6 @@ "site_admin": false, "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", "id": 17269309, diff --git a/utils/contributors.js b/utils/contributors.js index 0b3fab8..f76519e 100644 --- a/utils/contributors.js +++ b/utils/contributors.js @@ -25,6 +25,12 @@ const contributorRepos = [ ] +function isBlacklisted (login) { + if (login.match(/\[bot\]$/)) { + return true; + } +} + async function getContributors () { const output = []; for (const cr of contributorRepos) { @@ -35,7 +41,7 @@ async function getContributors () { }); const arr = await response.json(); for (const item of arr) { - if (item.login === "github-actions[bot]") { + if (isBlacklisted(item.login)) { continue; }