Skip to content

fix(release): stop goreleaser creating a duplicate draft for the same tag - #2957

Open
mikeland73 wants to merge 3 commits into
mainfrom
mikeland73/goreleaser-duplicate-draft
Open

fix(release): stop goreleaser creating a duplicate draft for the same tag#2957
mikeland73 wants to merge 3 commits into
mainfrom
mikeland73/goreleaser-duplicate-draft

Conversation

@mikeland73

Copy link
Copy Markdown
Contributor

Summary

goreleaser's use_existing_draft matches an existing draft by title, not by tag — its findDraftRelease compares r.GetName() == tag against the tag string it was handed — so any draft whose title wasn't verbatim the tag went unmatched and goreleaser silently created a second draft for that tag, with a bare list of commit SHAs for notes and all the artifacts on it (0.17.5, and 0.18.0 which is stuck on it now). This disables goreleaser's release pipe — it still builds every binary, archive and checksum into dist/, it just no longer owns the GitHub release — and has cli-release upload dist/ with gh release upload, which resolves drafts by tag via GraphQL and so maps a tag to exactly one release regardless of its title. Both ways of cutting a release keep working: devbox run draft-release creates the draft with its real title and hand-written notes before the tag is pushed and the artifacts land on it, while a tag pushed by hand gets a draft created from GitHub's generated notes to retitle and publish. Uploads use --clobber so re-running the workflow is idempotent. scripts/release.ts and the release skill are updated to describe the new path.

How was it tested?

goreleaser check parses the config and reports one skipped pipe (reason=release is disabled); a full local goreleaser release --clean --snapshot still produced all 7 artifacts (6 tarballs + checksums.txt) that the upload glob picks up; the new workflow step passes bash -n and dry-runs correctly for both a release tag and a prerelease tag; release.ts still runs.

Community Contribution License

All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.

By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.

🤖 Generated with Claude Code

mikeland73and others added 3 commits August 16, 2026 13:09
goreleaser's `use_existing_draft` matches an existing draft by *title*,
not by tag: findDraftRelease compares `r.GetName() == tag` against the
tag string it was handed. Any draft whose title wasn't verbatim the tag
went unmatched, so goreleaser created a second draft for the same tag —
with a bare list of commit SHAs for notes — and put all the artifacts on
it. That is what happened to 0.17.5 and 0.18.0. A matched draft fared no
better: CreateRelease overwrites the title from `name_template`, so a
hand-written title could never survive.
Disable goreleaser's release pipe instead. It still builds every binary,
archive and checksum into dist/; it just no longer owns the GitHub
release. cli-release uploads dist/ with `gh release upload`, which
resolves drafts by tag (GraphQL `release(tagName:)`), so a tag always
maps to exactly one release regardless of its title.
Both ways of cutting a release keep working. `devbox run draft-release`
creates the draft with its real title and notes before pushing the tag,
and the artifacts land on it. A tag pushed by hand has no draft, so
cli-release creates one titled after the tag with GitHub's generated
notes and uploads onto that; it stays a draft for a human to retitle and
publish. Uploads use --clobber so re-runs are idempotent.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The skill still described goreleaser attaching artifacts via
`use_existing_draft`. It now builds dist/ and nothing else; cli-release
does the upload, resolving the release by tag.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 16, 2026 20:10

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mikeland73