fix(bump-dev-version): warn when auto-merge can't complete without WORKFLOW_TOKEN - #433
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…rge:false is not an escape); sweep README + permissions
2026-08-07 02:44 UTC |
|
Claude finished review — View run All three prior inline findings and the README gap were addressed by commit Code review: #433Verification of round-1 fixes (against my prior review, posted here, verdict "Needs more work"):
Full-repo grep sweep (per CLAUDE.md's re-grep guidance): confirmed the only remaining New content check: I read the full diff of the round-1 fix commit and the resulting files in their current state. The new prose is factually consistent with GitHub's documented behavior (required status checks block manual merge button too, absent bypass rights), internally consistent across all four touched files, and doesn't introduce new inaccuracies. One trivial, non-blocking nit: No new bugs, syntax errors, or CLAUDE.md violations found in the round-1 fix commit. VerdictReady for merge — all three inline findings and the summary finding from the prior review round have been correctly and accurately addressed; no new issues found. |
Closes #409.
Problem
bump-dev-version'sauto-mergedefault cannot complete in a repo with required status checks. The bump PR is authored by the integratedGITHUB_TOKEN, and GitHub does not triggerpull_requestworkflow runs for aGITHUB_TOKEN-authored PR (it suppresses them to prevent recursion). So the required checks never report, and native auto-merge waits forever — the PR sits open on every merge until a human intervenes. The failure is silent: nothing at run time distinguishes it from success (the fail-fast shape).WORKFLOW_TOKENalready fixes this when set (it authors the PR as a real user, whosepull_requestruns are not suppressed), but the docs framed it as needed only "to push to a protected branch," so a consumer reasonably omits it and gets a permanently stuck PR.Changes
.github/workflows/bump-dev-version.yml): a new first step emits a::warning::(plus a step-summary note) whenauto-mergeis on andWORKFLOW_TOKENis unset, so the misconfiguration is visible up front instead of as a PR that never merges.examples/bump-dev-version.yml,website/reference/bump-dev-version.qmd, and theauto-mergeinput description): state thatWORKFLOW_TOKENis effectively required when the repo has required status checks andauto-mergeis on, and explain why.Warn, not hard-fail
The
auto-merge+ no-WORKFLOW_TOKENcombination is only unreachable when the repo has required checks. A repo without them auto-merges fine onGITHUB_TOKEN, so a hard failure would break that legitimate config. Detecting "has required checks" would need an API call and extra permissions; a loud warning covers the case the issue names without that complexity or that false-positive risk. The reasoning is recorded in a comment on the step.Notes on verification
The warning step lives in the reusable workflow, which
_selftest.yml'sdev-versionjob can't exercise (it calls thebump-dev-versioncomposite directly; the reusable workflow's own@v2refs don't resolve until the tag slides — the bootstrapping gap inCLAUDE.md). Validated byactionlint(which runs shellcheck on therun:block, exit 0) and by reading; the warning logic is a two-line shell conditional matching the existing "Enable auto-merge" step's env pattern.