fix(release): guard publish job against duplicate GitHub releases#610
Merged
Conversation
GoReleaser adopts release-please's draft release via use_existing_draft.
When that draft is absent at runtime (e.g. a failed publish that is later
retried), GoReleaser silently creates a brand-new release instead. That is
how plugin-validator/v0.42.8 ended up with two releases for one tag: an
orphaned draft with the changelog and no binaries, plus a published release
with the binaries and no notes.
Add a pre-flight guard to the release-to-github job that inspects existing
releases for the tag and:
- skips GoReleaser when a published release already exists (idempotent
re-runs can no longer create a duplicate),
- fails fast when no draft exists rather than letting GoReleaser create a
fresh release,
- fails on multiple drafts so the ambiguity is resolved by a human.
xnyo
approved these changes
Jun 9, 2026
academo
approved these changes
Jun 9, 2026
This was referenced Jun 9, 2026
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
.goreleaser.yamlusesuse_existing_draft: trueto adopt the draft release-please creates, then publishes it. If that draft is missing at runtime (e.g. a failedrelease-to-githubjob that's later re-run), GoReleaser creates a new release instead — which is howplugin-validator/v0.42.8got two releases for one tag (orphaned draft + published-without-notes).Add a pre-flight guard before GoReleaser:
Uses
gh api --jq(already on the runner) with the existing App token.Test plan
zizmor --offlinepassesv0.42.8(drafts=0, published=1-> skips, no duplicate)