fix(publish): verify release by id after upload, not by tag - #327
Merged
Conversation
Get-Release queries releases/tags/{tag} which can 404 transiently right
after gh release upload due to GitHub API eventual consistency. The
post-upload check (line 267) then saw $null and threw 'Release
disappeared or is no longer draft', failing publish after the first
asset uploaded successfully.
Add Get-ReleaseById (repos/{repo}/releases/{id}) and use it for the
post-upload verification. The release id is already known from the
in-progress $release object, so by-id is deterministic and avoids the
transient by-tag 404.
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.
Bug
After
gh release uploadsucceeds, the script re-queried the release by tag (releases/tags/{tag}) to confirm it was still a draft. GitHub's API can 404 transiently on the by-tag endpoint immediately after an asset upload (eventual consistency). This caused:…even though the draft release still existed and the asset uploaded fine.
Fix
Add
Get-ReleaseById(repos/{repo}/releases/{id}) and use it for the post-upload verification. The release id is already known from the in-progress `` object, so by-id is deterministic and avoids the transient by-tag 404.Verified: PowerShell parser check passes (
PARSE_OK).