From 03253261d8afe44fb565cafec1cb710c6e25f71b Mon Sep 17 00:00:00 2001 From: Ashish Kurmi Date: Thu, 9 Jul 2026 20:42:05 +0530 Subject: [PATCH] fix(ci): wait for release-list propagation before resolving draft tag GoReleaser creates the draft release for a tag pushed earlier in the same job, and GitHub can take a few seconds to index that tag before the new release shows up in the releases-list API. Querying immediately can return an empty list and fail with "Could not find draft release", even though the release was created successfully. Add a fixed 30s sleep before the lookup to give GitHub's API time to catch up. --- .github/workflows/release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6e7e7c..5425c27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,6 +76,13 @@ jobs: # GoReleaser creates draft releases under an "untagged-*" slug, # so gh release upload by version tag returns 404. Look up the # actual tag GitHub assigned to the draft. + # + # The release list endpoint lags the write by a few seconds when + # the release is tied to a tag pushed earlier in this same job + # (GitHub hasn't finished indexing the tag yet) — querying + # immediately can return an empty list even though the release + # exists. Give it a moment before looking it up. + sleep 30 release_tag=$(gh api "repos/${{ github.repository }}/releases" \ --jq '[.[] | select(.draft and .tag_name == "${{ steps.version.outputs.tag }}")] | first | .tag_name') if [ -z "$release_tag" ] || [ "$release_tag" = "null" ]; then