ci(release): skip CI and the approval gate on version-bump PRs#2318
Conversation
The Create Release PR workflow opens a `release/X.Y.Z` PR that only bumps version files and posts passing check runs for every required context, so the full CI suite is redundant on these PRs. Two problems remained: 1. create-pull-request defaults the commit *author* to `github.actor` (the human who ran the workflow), so the PR commit looked user-authored. That defeated GitHub's GITHUB_TOKEN recursion guard, so the on:pull_request CI workflows were queued and parked in `action_required` — surfacing the unwanted "Approve and run workflows" prompt and, once approved, running the full ~20-min suite redundantly. 2. Even if approved, that CI is pointless for a version-only PR. Fixes: - Fully attribute the release commit to github-actions[bot] (author + committer) so the recursion guard suppresses the pull_request runs entirely — no approval gate; the synthetic checks satisfy branch protection on their own. - Add a `!startsWith(github.head_ref, 'release/')` guard to every PR-triggered CI job (test, windows, typecheck, lint, semgrep, executable-check) as defense-in-depth: if a run is ever triggered/approved on a release PR, the heavy jobs skip instead of running. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The previous commit keyed the CI skip on `github.head_ref` (the branch name), which any PR author controls. A contributor could open a PR from a branch named `release/anything` and have every required check (Lint, Typecheck, Test, Semgrep, executable verify) skip — a required-status-check bypass. Re-gate the skip on identity that an attacker cannot forge: the PR must be opened by github-actions[bot], from this same repository (not a fork), on a release/* branch. Verified the skip fires only for the genuine automated release PR; fork PRs, same-repo non-bot PRs, and normal PRs all run CI as before. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude Code PR ReviewPR: #2318 • Head: 3647f9f • Reviewers: stack:code-reviewer SummaryModifies seven GitHub Actions workflows so the automated Create Release PR flow (a Review Table
Findings
Security / forgeability: Reviewer independently confirmed the gate is sound — the three chained predicates ( Verdict: PASS — Logic and security model are correct and validated end-to-end. The sole High finding is refuted by the repo's actual branch-protection config and a live fork test; only optional Low nits remain. |
Problem
The Create Release PR workflow opens a
release/X.Y.ZPR that only bumps version files and already posts passing check runs for every required context. But on the last real release PR (#2317) the full CI suite still got involved:peter-evans/create-pull-requestdefaults the commit author to${{ github.actor }}— the human who clicked Run workflow — so the commit looked user-authored (committer was stillgithub-actions[bot]).GITHUB_TOKENrecursion guard, so theon: pull_requestCI workflows were queued and parked inaction_required→ the unwanted "Approve and run workflows" prompt.BLOCKEDuntil it finished.Confirmed on #2317: attempt 1
conclusion = action_required(triggered bygithub-actions[bot]), attempt 2 triggered by a human clicking approve.Fix
github-actions[bot](bothauthorandcommitter) inversion-bump.yml, so GitHub's recursion guard suppresses thepull_requestruns entirely. No approval gate; the synthetic check runs satisfy branch protection on their own.!startsWith(github.head_ref, 'release/')guard to every PR-triggered CI job (test,windows,typecheck,lint,semgrep,executable-check). If a run is ever triggered/approved on a release PR anyway, the heavy jobs skip instead of running.Resulting release flow (3 manual clicks)
Notes
draft-release.ymlis intentionally untouched (it's part of the release flow, runs only on merged "Release …" PRs).🤖 Generated with Claude Code