From 37a0c3564daa4f85f1b31d16aec41b2ea19af1d8 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Sun, 22 Nov 2026 10:10:06 -0800 Subject: [PATCH] Do not label issues assigned to org bots as community contributions - Move bot usernames into scripts/bot-usernames.json, read by constants.js and the Python script - community-contribution-label.py treats a bot assignee as not external Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013PjXpbvgyWdsP6RKke6npi --- scripts/bot-usernames.json | 6 ++++++ scripts/community-contribution-label.py | 5 +++++ scripts/constants.js | 15 +++++---------- 3 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 scripts/bot-usernames.json diff --git a/scripts/bot-usernames.json b/scripts/bot-usernames.json new file mode 100644 index 0000000..6f37620 --- /dev/null +++ b/scripts/bot-usernames.json @@ -0,0 +1,6 @@ +{ + "le_bot": "learning-equality-bot[bot]", + "sentry": "sentry-io[bot]", + "dependabot": "dependabot[bot]", + "rtibblesbot": "rtibblesbot" +} diff --git a/scripts/community-contribution-label.py b/scripts/community-contribution-label.py index 30e60ee..2e899c6 100644 --- a/scripts/community-contribution-label.py +++ b/scripts/community-contribution-label.py @@ -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}"} diff --git a/scripts/constants.js b/scripts/constants.js index b06f05c..56cc53a 100644 --- a/scripts/constants.js +++ b/scripts/constants.js @@ -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',