Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scripts/bot-usernames.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"le_bot": "learning-equality-bot[bot]",
"sentry": "sentry-io[bot]",
"dependabot": "dependabot[bot]",
"rtibblesbot": "rtibblesbot"
}
5 changes: 5 additions & 0 deletions scripts/community-contribution-label.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import json
import logging
import os
from pathlib import Path

import requests

logger = logging.getLogger(__name__)

BOT_USERNAMES = set(json.loads((Path(__file__).parent / "bot-usernames.json").read_text()).values())


def get_user_type(owner, repo, username, token):
if not username:
return None
if username in BOT_USERNAMES:
return "bot"

url = f"https://api.github.com/repos/{owner}/{repo}/collaborators/{username}"
headers = {"Authorization": f"token {token}"}
Expand Down
15 changes: 5 additions & 10 deletions scripts/constants.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
// See docs/community-automations.md

const LE_BOT_USERNAME = 'learning-equality-bot[bot]';
const SENTRY_BOT_USERNAME = 'sentry-io[bot]';
const DEPENDABOT_USERNAME = 'dependabot[bot]';
const RTIBBLESBOT_USERNAME = 'rtibblesbot';
const BOT_USERNAMES = [
LE_BOT_USERNAME,
SENTRY_BOT_USERNAME,
DEPENDABOT_USERNAME,
RTIBBLESBOT_USERNAME,
];
const BOTS = require('./bot-usernames.json');

const LE_BOT_USERNAME = BOTS.le_bot;
const RTIBBLESBOT_USERNAME = BOTS.rtibblesbot;
const BOT_USERNAMES = Object.values(BOTS);

const MAINTAINER_TEAMS = [
'le-admins-team',
Expand Down
Loading