Repository navigation
fix(release): allow tag cuts when main requires pull requests - #29985
Conversation
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8086b997-89f8-45b5-b1a1-cc5c02732995
📒 Files selected for processing: 3
.github/CONTRIBUTING.md.github/workflows/release-cut.ymlconfig/scripts/release-protected-main-push.test.mjs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| push_log="$RUNNER_TEMP/release-push-main.log" | ||
| if git push origin "HEAD:refs/heads/main" >"$push_log" 2>&1; then | ||
| cat "$push_log" | ||
| elif grep -Fq 'GH013' "$push_log" && grep -Fq 'Changes must be made through a pull request.' "$push_log"; then |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Reject GH013 responses with additional rule violations.
If GitHub reports both the pull-request rule and another violation, both grep checks succeed. The workflow then pushes the release tag, although the stated policy requires other main push errors to stop the cut. GH013 responses can contain both a pull-request requirement and a signature violation. Accept the fallback only when the pull-request requirement is the sole reported violation, and add a mixed-violation test. (github.com)
ELI5
Main now requires pull requests, so cutting a release fails before its tag is pushed. Keep that protection and let the release publish its tag without changing main.
What Changed
The cut workflow still attempts its normal version fast-forward. If GitHub specifically rejects it with GH013 and the pull-request requirement, it logs the reason, leaves main unchanged, and pushes the release tag. Other main push errors and all tag push errors still fail.
Why
The fresh cut from main was rejected by the new rule. The release already builds from a detached version commit, so main does not need a direct update. This preserves branch protection without adding a privileged token or weakening the release checks.
Linked Issue
Release recovery; no existing issue.
Visual Proof
N/A — release automation only.
Testing
45 focused tests pass on macOS. Six new tests execute the actual workflow shell with simulated git responses: protected main, allowed fast-forward, unrelated rule rejection, connection failure, off-main cut, and tag rejection. Permission and macOS dispatch contracts also pass. Changed-code quality and formatting pass. PR CI will exercise the changed workflow and tests before merging.
Review
Self-reviewed that the fallback recognizes the specific pull-request rule, never forces a push, and leaves artifact/publication gates intact.
Agent skill upstream boundary
Notes
Main may retain its previous package version when direct updates are prohibited. The release tag carries the new version. No app, SSH, mobile, remote protocol, or Git provider behavior changes.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)