Repository navigation
ci: delete stale release branch before creating release PR - #133
Merged
Merged
Conversation
The org ruleset gpg-sign-enforce blocks force-pushes. When a previous release PR was closed without merging, changeset-release/main still existed and the Changesets action failed to update it. Delete the branch first so the action always creates a new one. Co-authored-by: Cursor <cursoragent@cursor.com>
The release workflow deletes changeset-release/main before running Changesets, so an open release PR is closed and a new one is opened. Co-authored-by: Cursor <cursoragent@cursor.com>
chaitanyapotti
approved these changes
Nov 12, 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.
Motivation and Context
The "Create release pull request" workflow failed on run 43175986280 with
Cannot force-push to this branch. The org rulesetgpg-sign-enforceblocks non-fast-forward updates on every branch.The run before it opened release PR #132. Then #129 landed on
main, and the workflow ran again while #132 was still open. To update an open release PR, the Changesets action rewriteschangeset-release/mainfrom the newmaincommit. That is a force-push, so GitHub rejected it.This is the normal release flow, so any re-run while a release PR is open fails today.
Description
Before running the Changesets action, delete
changeset-release/mainon the remote if it exists. The action then creates a fresh branch, which is not a force-push.Side effect: when a release PR is open, which is the usual case for a re-run, deleting its branch closes that PR and a new one is opened. Review comments and approvals on the old PR do not carry over.
The ruleset has no "restrict deletions" rule on this branch, so the delete is allowed. An alternative with no workflow change is to exclude
changeset-release/**from the ruleset's force-push block, which keeps the open PR. That is an org policy decision, so this PR does not do it.How has this been tested?
yamllint.mainafter merge.Screenshots (if appropriate)
N/A
Types of changes
CI-only change, no package behavior affected.
Checklist
Made with Cursor
Note
Low Risk
CI workflow and documentation only; no runtime package behavior changes. The tradeoff is recycled release PRs instead of in-place branch updates.
Reviewed by Cursor Bugbot for commit a90adfb. Bugbot is set up for automated code reviews on this repo. Configure here.