mirror of
https://github.com/web3privacy/web
synced 2024-10-15 18:26:27 +02:00
blacklist bots from contrib counters
This commit is contained in:
parent
24875fd8da
commit
2884a56045
2 changed files with 7 additions and 22 deletions
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue