fix(release): draft-first pattern to avoid immutability failure on retag#580
Merged
Conversation
softprops/action-gh-release now creates the GitHub release as a draft while uploading assets; a final step publishes it after all assets are uploaded. This prevents the "target_commitish cannot be changed when release is immutable" error observed on workflow v0.24.0 when retrying a failed release on an existing tag. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions release workflow to avoid GitHub “immutable release” failures when rerunning a release for an existing tag by creating/updating the release as a draft during asset upload, then publishing it only after uploads succeed.
Changes:
- Switch
softprops/action-gh-releaseto create the release as a draft during the upload step. - Add a follow-up
gh release edit ... --draft=falsestep to publish the release after assets are uploaded.
Comment on lines
+276
to
+277
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: gh release edit ${{ env.TAG_NAME }} --draft=false --repo ${{ github.repository }} |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
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
.github/workflows/release.yml: changeCreate Releasestep todraft: trueand add aPublish releasestep after asset upload completesWhy
The
"target_commitish cannot be changed when release is immutable"error occurs whensoftprops/action-gh-releaseattempts to update an existing (already-published) release for a tag. By starting as a draft, the action can safely create/update the release and upload assets without hitting the immutability gate. The separategh release edit --draft=falsestep only fires after all assets are uploaded successfully.The downstream jobs (
update-homebrew,notify-ide-plugins) already depend on thereleasejob completing, so they fire naturally after the publish step — no sequencing changes needed.Test plan
v0.25.0) and verify the release starts as draft, all binary + UI assets upload, then the release becomes public🤖 Generated with Claude Code