File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -497,6 +497,21 @@ jobs:
497497 --notes-file "$notes"
498498 fi
499499
500+ # The releases-by-tag endpoint does not return draft releases, so
501+ # resolve the draft release by its ID before uploading and verifying
502+ # assets. The asset digests are verified again after publication.
503+ release_id="$(
504+ gh api \
505+ -H "X-GitHub-Api-Version: 2026-03-10" \
506+ "repos/$GITHUB_REPOSITORY/releases?per_page=100" \
507+ --jq '.[] | select(.tag_name == "'"$RELEASE_TAG"'" and .draft == true) | .id' \
508+ | head -1
509+ )"
510+ if [[ -z "$release_id" ]]; then
511+ echo "Unable to resolve the draft release $RELEASE_TAG" >&2
512+ exit 1
513+ fi
514+
500515 gh release upload "$RELEASE_TAG" \
501516 --repo "$GITHUB_REPOSITORY" \
502517 --clobber \
@@ -508,7 +523,7 @@ jobs:
508523
509524 gh api \
510525 -H "X-GitHub-Api-Version: 2026-03-10" \
511- "repos/$GITHUB_REPOSITORY/releases/tags/$RELEASE_TAG " > "$remote_json"
526+ "repos/$GITHUB_REPOSITORY/releases/$release_id " > "$remote_json"
512527 verify_release_assets draft
513528
514529 # Reduce tag and setting drift windows between preflight and publication.
You can’t perform that action at this time.
0 commit comments