Skip to content

Commit e24faa5

Browse files
committed
fix(ci): resolve draft release by tag_name to avoid race
The jq filter in the 'Resolve draft release tag' step matched on .name, which GitHub populates asynchronously after release creation. Runs that queried too quickly (<~2s after GoReleaser) got an empty result and failed with 'Could not find draft release'. Match on .tag_name instead — it is set atomically at creation time.
1 parent 19723f3 commit e24faa5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
# so gh release upload by version tag returns 404. Look up the
7575
# actual tag GitHub assigned to the draft.
7676
release_tag=$(gh api "repos/${{ github.repository }}/releases" \
77-
--jq '[.[] | select(.draft and .name == "${{ steps.version.outputs.tag }}")] | first | .tag_name')
77+
--jq '[.[] | select(.draft and .tag_name == "${{ steps.version.outputs.tag }}")] | first | .tag_name')
7878
if [ -z "$release_tag" ] || [ "$release_tag" = "null" ]; then
7979
echo "::error::Could not find draft release for ${{ steps.version.outputs.tag }}"
8080
exit 1

0 commit comments

Comments
 (0)