Skip to content

ci: delete stale release branch before creating release PR - #133

Merged
chaitanyapotti merged 2 commits into
mainfrom
ci/release-pr-delete-stale-branch
Nov 12, 2026
Merged

chaitanyapotti merged 2 commits into
mainfrom
ci/release-pr-delete-stale-branch

Conversation

@tuna1207

@tuna1207 tuna1207 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Motivation and Context

The "Create release pull request" workflow failed on run 43175986280 with Cannot force-push to this branch. The org ruleset gpg-sign-enforce blocks 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 rewrites changeset-release/main from the new main commit. 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/main on 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?

  • YAML syntax checked with yamllint.
  • Not yet run in Actions. Verify by running "Create release pull request" from main after merge.

Screenshots (if appropriate)

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

CI-only change, no package behavior affected.

Checklist

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

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.

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>
@tuna1207
tuna1207 requested a review from a team as a code owner November 12, 2026 07:41
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
chaitanyapotti merged commit a0cc3a8 into main Nov 12, 2026
14 checks passed
@chaitanyapotti
chaitanyapotti deleted the ci/release-pr-delete-stale-branch branch November 12, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants