Repository navigation
fix(release): next-reset reads the released PR + fails safe to preserve next (#278) - #279
Merged
Merged
Conversation
…ve next (#278) workflow-next-reset.yml decides whether a release was a normal (next → master) or hotfix (hotfixes → master) release by reading the merged PR's head ref with `gh pr view`. Two defects made every hotfix release force-reset `next` and drop its queued commits: 1. The app-token step requested only contents + workflows. create-app-token switches to fine-grained mode as soon as any permission flag is set, granting ONLY the requested scopes — so the token had no pull-requests permission, `gh pr view` was silently denied (error swallowed by 2>/dev/null), the lane resolved to "other" for every hotfix, and next was force-reset. The merge path was dead code. Proven on CLDMV/gh-broker run 34014340050, which logged "released PR #46 head ref: <unknown>" then reset next to 6902569. 2. The detection failed OPEN to the destructive path: an unreadable/unknown head defaulted to lane=other (reset). Fixes: - Grant permission_pull_requests on the token so the lane can be read. - Fail SAFE: run the reset only when the head ref is positively a non-hotfixes branch; an unknown/unreadable head falls through to the hotfix/preserve (merge) path, never the reset. Surface the gh error instead of swallowing it. Version-collision (concurrent hotfix + next resolving to the same X.Y.Z) and a redundant release-PR auto-close guard remain as separate follow-ups. Fixes #278
There was a problem hiding this comment.
🔵 Needs a closer look
It changes release automation that can force-update long-lived branches, so a human should sanity-check the new permissioning and lane fallback behavior before approval.
Pull request overview
Updates the v4 reusable workflow-next-reset workflow to correctly detect whether a release: commit came from the hotfixes → master lane versus a normal release lane, so next is preserved on hotfix releases (avoiding silent data loss described in #278).
Changes:
- Request
pull-requestspermission on the minted App token sogh pr viewcan read the released PR’sheadRefNameduring lane detection. - Make lane detection surface
gh pr viewerrors and default to the “preserve next” path when the released PR head ref can’t be determined.
File summaries
| File | Description |
|---|---|
| .github/workflows/workflow-next-reset.yml | Adds PR permission + safer lane detection to prevent force-resetting next after hotfix releases. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Shinrai
previously approved these changes
Sep 6, 2026
…set lane detection create-app-token gains a permission_pull_requests_read flag that requests the fine-grained pull-requests READ scope (write still available via permission_pull_requests, which wins when both are set). workflow-next-reset switches to it: the lane detection only reads the released PR's head ref via `gh pr view`, so read is sufficient — the bot token no longer needs pull-requests write. (#278)
Shinrai
approved these changes
Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 What's Changed
💥 Breaking Changes
No breaking changes
✨ Features
No new features
🐛 Bug Fixes
nexttomaster, dropping next's queued commits and auto-closing thenext→masterrelease PR (silent data loss) #278) (6fd8038)📦 Dependencies
No dependency updates
🔧 Other Changes
👥 Contributors