Skip to content

fix(release): make just release idempotent for re-runs#948

Merged
wpfleger96 merged 1 commit into
mainfrom
worktree-wpfleger-idempotent-release
Jun 10, 2026
Merged

fix(release): make just release idempotent for re-runs#948
wpfleger96 merged 1 commit into
mainfrom
worktree-wpfleger-idempotent-release

Conversation

@wpfleger96

Copy link
Copy Markdown
Collaborator

Running just release after a release PR already existed failed with "branch already exists." Now re-running it with the same version detects the existing branch and PR, resets to current main so newly merged commits are included, regenerates the changelog and PR body, amends the release commit, and updates the PR in place via gh pr edit.

  • Branch creation uses three-way detection: reuse local, checkout remote, or create fresh
  • Commit amends when the previous message matches the release pattern, keeping the branch as a single commit on top of main
  • Push uses --force-with-lease for safe overwrites
  • PR creation checks gh pr list --head and falls back to gh pr edit when a PR already exists
  • Updated RELEASING.md with re-run docs and a new troubleshooting entry

Running `just release` after a release PR already exists failed with
"branch already exists." Now it detects an existing branch/PR and
updates them: resets the branch to current origin/main, amends the
release commit, force-pushes, and edits the PR via `gh pr edit`.
@wpfleger96 wpfleger96 requested a review from a team as a code owner June 10, 2026 16:49
@wpfleger96 wpfleger96 merged commit 5c0af0b into main Jun 10, 2026
14 checks passed
@wpfleger96 wpfleger96 deleted the worktree-wpfleger-idempotent-release branch June 10, 2026 16:50
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.

1 participant