Uh oh!
There was an error while loading. Please reload this page.
Reuse existing draft release in goreleaser - #2855
Merged
Merged
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>
mikeland73
requested review from
Lagoja and Copilot
and removed request for
CopilotJune 7, 2026 19:37
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GoReleaser GitHub release configuration to preserve an existing draft release’s description/body when publishing artifacts for a tag, instead of regenerating (and potentially overwriting) the release notes.
Changes:
- Set
release.mode: keep-existingto keep existing release notes/body when a release already exists. - Set
release.replace_existing_draft: falseto avoid deleting and recreating an existing draft release.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+46
to
+47
| mode: keep-existing | ||
| replace_existing_draft: false |
CollaboratorAuthor
There was a problem hiding this comment.
Good catch — added both use_existing_draft: true and replace_existing_artifacts: true in d08ce96. The first resolves exactly the draft-lookup caveat I'd flagged (get-release-by-tag doesn't return drafts), and the second avoids 422s on tag re-runs.
Per PR review: use_existing_draft makes goreleaser find and attach to an existing draft release (the get-release-by-tag API doesn't return drafts), and replace_existing_artifacts lets re-runs on the same tag overwrite assets instead of failing with a 422. 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 freeto 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