Reuse existing draft release in goreleaser#2855
Open
mikeland73 wants to merge 1 commit into
Open
Conversation
Set mode: keep-existing and replace_existing_draft: false so that a tag push reuses an existing draft release (preserving its description) instead of creating a duplicate draft. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Configure goreleaser to reuse an existing draft release on tag push instead of creating a new one.
On tag push, the
releasejob in.github/workflows/cli-release.ymlrunsgoreleaser release --clean. With onlydraft: trueset, goreleaser would generate a fresh release body, which can clobber or duplicate a draft release that already exists for the tag.Change
In
.goreleaser.yaml'srelease:block:mode: keep-existing— reuse an existing release for the tag and leave its description as-is (just attach the built artifacts). Creates one if none exists.replace_existing_draft: false— explicitly avoid deleting-and-recreating an existing draft, preserving a hand-written description.Note
GitHub's "get release by tag" API doesn't return drafts, so reuse depends on goreleaser's draft-aware lookup. Worth confirming on the next tag push that artifacts attach to the existing draft rather than spawning a second one.
🤖 Generated with Claude Code