From 32a4a4a87558a25147de4a14412274e35929d00e Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Wed, 7 Oct 2026 10:51:15 +0000 Subject: [PATCH 1/3] Link to all of a proposed contributor's pull requests in the description --- .github/scripts/update_vetting_allowlist.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/scripts/update_vetting_allowlist.py b/.github/scripts/update_vetting_allowlist.py index 4ba66bb..9d12c39 100644 --- a/.github/scripts/update_vetting_allowlist.py +++ b/.github/scripts/update_vetting_allowlist.py @@ -19,6 +19,7 @@ import os import re import sys +import urllib.parse import urllib.request from datetime import UTC, date, datetime, timedelta @@ -38,7 +39,7 @@ If you believe any of them should not be added to the allowlist, for example if they have violated the AI policy, keep them in the allowlist but prefix their username with a - """ -PR_BODY_ENTRY = "* @{user} ({count} merged pull requests, https://github.com/pulls?q=org%3A{org}+type%3Apr+is%3Amerged+author%3A{user})" +PR_BODY_ENTRY = "* @{user} ({count} merged pull requests, [all pull requests to the {org} org](https://github.com/pulls?q=org%3A{org}+type%3Apr+author%3A{user_quoted}))" PR_BODY_NOTHING = "No contributors to add." SEARCH_LIMIT = 1000 # results per search query, imposed by GitHub COUNT_BATCH_SIZE = 50 # users per GraphQL request when counting merged pull requests @@ -151,7 +152,9 @@ def main(): if not additions: print(PR_BODY_NOTHING) return - entries = "\n".join(PR_BODY_ENTRY.format(user=user, count=counts[user], org=ORG) for user in additions) + entries = "\n".join( + PR_BODY_ENTRY.format(user=user, user_quoted=urllib.parse.quote(user), count=counts[user], org=ORG) for user in additions + ) print(PR_BODY.format(min_merged=MIN_MERGED, org=ORG, entries=entries), end="") now = datetime.now(UTC).strftime("%Y-%m-%dT%H:%M:%S") From 67e043dd056cbc69cbafe92e2ccb89d0f28070af Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Wed, 7 Oct 2026 10:51:56 +0000 Subject: [PATCH 2/3] Do not mention proposed contributors with @ in the description to avoid notifying them --- .github/scripts/update_vetting_allowlist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/update_vetting_allowlist.py b/.github/scripts/update_vetting_allowlist.py index 9d12c39..26eae37 100644 --- a/.github/scripts/update_vetting_allowlist.py +++ b/.github/scripts/update_vetting_allowlist.py @@ -39,7 +39,7 @@ If you believe any of them should not be added to the allowlist, for example if they have violated the AI policy, keep them in the allowlist but prefix their username with a - """ -PR_BODY_ENTRY = "* @{user} ({count} merged pull requests, [all pull requests to the {org} org](https://github.com/pulls?q=org%3A{org}+type%3Apr+author%3A{user_quoted}))" +PR_BODY_ENTRY = "* {user} ({count} merged pull requests, [all pull requests to the {org} org](https://github.com/pulls?q=org%3A{org}+type%3Apr+author%3A{user_quoted}))" PR_BODY_NOTHING = "No contributors to add." SEARCH_LIMIT = 1000 # results per search query, imposed by GitHub COUNT_BATCH_SIZE = 50 # users per GraphQL request when counting merged pull requests From f37b3bc43f5c0f5585cd1fa511a6009f6fd75bed Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Wed, 7 Oct 2026 11:09:33 +0000 Subject: [PATCH 3/3] Run the allowlist script on pull requests that change it without opening a pull request --- .github/workflows/update-vetting-allowlist.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-vetting-allowlist.yml b/.github/workflows/update-vetting-allowlist.yml index 6952825..77d5bd6 100644 --- a/.github/workflows/update-vetting-allowlist.yml +++ b/.github/workflows/update-vetting-allowlist.yml @@ -1,6 +1,8 @@ # Once a week, add contributors who have had enough pull requests merged in # the organization to the vetting allowlist, and open a pull request with the -# additions. Can also be run by hand from the Actions tab. +# additions. Can also be run by hand from the Actions tab. On pull requests +# that change the script or this workflow, the script is run and its output +# shown, but no pull request is opened. # # Pull requests are opened with the workflow token, which requires "Allow # GitHub Actions to create and approve pull requests" to be enabled in the @@ -12,6 +14,10 @@ on: schedule: - cron: "0 6 * * 1" workflow_dispatch: + pull_request: + paths: + - .github/scripts/update_vetting_allowlist.py + - .github/workflows/update-vetting-allowlist.yml permissions: contents: write @@ -37,7 +43,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: python .github/scripts/update_vetting_allowlist.py > /tmp/allowlist-update.md + - name: Show the proposed changes + run: | + echo "::group::Pull request description" + cat /tmp/allowlist-update.md + echo "::endgroup::" + git --no-pager diff + - name: Open a pull request with the additions + if: github.event_name != 'pull_request' uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: add-paths: contributor-allowlist.txt