From 19204f57572aafbb755120f34eb3b2ef45f34fd2 Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Fri, 23 Oct 2026 17:35:12 -0400 Subject: [PATCH] ci: let a PR opt out of automatic AI review (#11984) A PR whose body contains `[skip-ai-review]` no longer triggers the automatic Codex, Pi and Claude reviews on open/ready/synchronize, and is left out of the weekly merged-PR summary. Explicit requests (workflow_call from the review commands) still run. Co-authored-by: Claude Opus 5.5 --- .github/workflows/codex-pr-review.yml | 4 +++- .github/workflows/pi-pr-review.yml | 4 +++- .github/workflows/pr-ready-review.yml | 4 +++- .github/workflows/weekly-pr-summary.yml | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codex-pr-review.yml b/.github/workflows/codex-pr-review.yml index 2d70ad7f7a..e1628729d8 100644 --- a/.github/workflows/codex-pr-review.yml +++ b/.github/workflows/codex-pr-review.yml @@ -42,12 +42,14 @@ jobs: # skips auto-review for every private member. # Dependabot-triggered runs get a separate secret scope, so this job has no API # key and cannot review. workflow_call stays open for an explicit request. + # `[skip-ai-review]` in the PR body opts out of the automatic run only. if: | github.event_name == 'workflow_call' || ( github.event.pull_request.draft == false && github.event.pull_request.head.repo.fork == false && - github.event.pull_request.user.login != 'dependabot[bot]' + github.event.pull_request.user.login != 'dependabot[bot]' && + !contains(github.event.pull_request.body, '[skip-ai-review]') ) permissions: contents: read diff --git a/.github/workflows/pi-pr-review.yml b/.github/workflows/pi-pr-review.yml index a18dc28ff2..4b57db7b78 100644 --- a/.github/workflows/pi-pr-review.yml +++ b/.github/workflows/pi-pr-review.yml @@ -40,12 +40,14 @@ jobs: # skips auto-review for every private member. # Dependabot-triggered runs get a separate secret scope, so this job has no API # key and cannot review. workflow_call stays open for an explicit request. + # `[skip-ai-review]` in the PR body opts out of the automatic run only. if: | github.event_name == 'workflow_call' || ( github.event.pull_request.draft == false && github.event.pull_request.head.repo.fork == false && - github.event.pull_request.user.login != 'dependabot[bot]' + github.event.pull_request.user.login != 'dependabot[bot]' && + !contains(github.event.pull_request.body, '[skip-ai-review]') ) permissions: contents: read diff --git a/.github/workflows/pr-ready-review.yml b/.github/workflows/pr-ready-review.yml index 90714cba53..4b88273cad 100644 --- a/.github/workflows/pr-ready-review.yml +++ b/.github/workflows/pr-ready-review.yml @@ -39,12 +39,14 @@ jobs: # skips auto-review for every private member. # Dependabot-triggered runs get a separate secret scope, so this job has no API # key and cannot review. workflow_call stays open for an explicit request. + # `[skip-ai-review]` in the PR body opts out of the automatic run only. if: | github.event_name == 'workflow_call' || ( (github.event.pull_request.draft == false || github.event.pull_request.ready_for_review == true) && github.event.pull_request.head.repo.fork == false && - github.event.pull_request.user.login != 'dependabot[bot]' + github.event.pull_request.user.login != 'dependabot[bot]' && + !contains(github.event.pull_request.body, '[skip-ai-review]') ) permissions: contents: read diff --git a/.github/workflows/weekly-pr-summary.yml b/.github/workflows/weekly-pr-summary.yml index 9d1f0631fb..14551e9943 100644 --- a/.github/workflows/weekly-pr-summary.yml +++ b/.github/workflows/weekly-pr-summary.yml @@ -39,9 +39,10 @@ jobs: - This gives you the exact 7-day window (store these in variables for use in commands) 2. **Fetch ONLY Merged PRs from Past Week**: - - Command: `gh pr list --repo ${{ github.repository }} --state merged --search "merged:>=$CUTOFF_DATE" --limit 100 --json number,title,author,mergedAt,url` + - Command: `gh pr list --repo ${{ github.repository }} --state merged --search "merged:>=$CUTOFF_DATE" --limit 100 --json number,title,author,mergedAt,url,body --jq '[.[] | select((.body // "") | contains("[skip-ai-review]") | not) | del(.body)]'` - This returns ONLY PRs that were merged in the last 7 days - The --search flag filters by merge date using GitHub's search syntax + - The --jq filter drops PRs whose body contains `[skip-ai-review]`; never fetch or mention those PRs - **FILTER OUT** any PRs with titles starting with "chore: release" or "chore(release)" 3. **Categorize PRs**: Group PRs into three categories by analyzing titles and labels: