ci: make release workflow idempotent [4.x]#117
Merged
ManukMinasyan merged 1 commit into4.xfrom Apr 28, 2026
Merged
Conversation
Previously the workflow failed with "Release.tag_name already exists" when a release was authored manually (which auto-creates the tag and triggers this workflow). Skip creation if the release already exists. Also drop the now-unused checkout steps and use the GitHub API for tag deletion in the cleanup job, which removes the need for a working tree.
Contributor
There was a problem hiding this comment.
Pull request overview
Makes the 4.x release workflow idempotent so it no longer fails when a release is created manually (which auto-creates the tag and re-triggers the workflow). This keeps tests as the gate while avoiding a duplicate gh release create attempt and simplifying cleanup.
Changes:
- Skip
gh release createwhen a release for the pushed tag already exists (gh release viewgate). - Remove redundant
actions/checkoutusage fromreleaseandcleanupjobs. - Replace
git push --deletetag cleanup withgh api -X DELETEagainst the refs API.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
The release workflow has been failing whenever a release is authored manually in the GitHub UI (or via
gh release createlocally). Manual release creation auto-creates the tag, which triggersrelease.yml, which then re-runsgh release createand fails with:Recent failures: v4.0.7, v4.0.8 (twice), v4.0.11. Runs that succeeded (v4.0.9, v4.0.10) were ones where only a tag was pushed and the workflow itself created the release.
Changes
gh release createwhen a release for the tag already exists. Tests still run as a gate, so manually-published releases are still validated.actions/checkoutfrom bothreleaseandcleanupjobs.gh release create --generate-notesqueries the GitHub API and doesn't need a local checkout; same for tag deletion.gh api DELETEfor cleanup instead ofgit push --delete. Removes the implicit dependency on having a working tree set up.Test plan