Repository navigation
Fail the release when the tag's GitHub release is already published - #10665
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The release state is not revalidated before external publishing, leaving a race that can still cause partial publication.
1 open issue
What changed in this PR
Updates the release workflow to prevent package publishing when the tag already has a published GitHub release, while preserving reuse of existing draft releases.
Changes:
- Detects published, draft, and absent releases.
- Fails early for already-published releases.
- Gates package and Nitro operation publishing on successful draft preparation.
| File | Description |
|---|---|
.github/workflows/release.yml |
Adds release-state validation and gates publishing jobs on successful draft validation. |
Review effort: Lite
This was referenced Oct 25, 2026
Merged
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
A release created through the GitHub UI instead of by pushing a tag is already published when the release workflow starts, and an immutable release can't take assets after publication. The workflow skipped draft creation for such a release, published every package, and only failed when attaching the assets at the end.
create-draftjob now fails when the tag's release exists and is not a draft. An existing draft is still reused, so re-running a release keeps working.publish-nuget,publish-npm,publish-nitro-ops, andpublish-aspire-nitro-opsnow needcreate-draft, so a release that is already published when the run starts stops the run before anything is published. The build jobs still run alongside it.Test plan
16.0.0) fails with the error, and a tag without a release goes on to create the draft.ghthat reports an existing draft: it reuses the draft and exits successfully.