From 951a9eeb10a7873e4c15160d42d507cfdd770af4 Mon Sep 17 00:00:00 2001 From: sebasnallar Date: Wed, 26 Aug 2026 11:04:25 -0300 Subject: [PATCH] fix(release-publish-oci): discard release lookup capture on HTTP error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gh api prints the error BODY to stdout on failure, so the direct releases/tags/ lookup captured a 404's JSON as the release id and fed it into the next request ("unsupported protocol scheme"), failing the finalize job before the list fallback could run. Reset the capture on non-zero exit so the fallback (and the create-release upsert path) actually execute. Hit on scopes-lambda's first real run — publish and artifact registration succeeded; only the release body step died. Co-Authored-By: Claude Fable 5 --- .github/workflows/release-publish-oci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-publish-oci.yml b/.github/workflows/release-publish-oci.yml index 0ec79d7..8961b13 100644 --- a/.github/workflows/release-publish-oci.yml +++ b/.github/workflows/release-publish-oci.yml @@ -283,8 +283,13 @@ jobs: # Direct lookup first; drafts are not resolvable via releases/tags, # so fall back to listing (upsert also covers backfilled tags that - # never had a release). - RELEASE_ID=$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$TAG" --jq '.id' 2>/dev/null || true) + # never had a release). On an HTTP error gh api prints the error + # BODY to stdout — the capture must be discarded on a non-zero + # exit, or a 404's JSON gets used as a release id and the next + # request is garbage. + if ! RELEASE_ID=$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$TAG" --jq '.id'); then + RELEASE_ID="" + fi if [ -z "$RELEASE_ID" ]; then RELEASE_ID=$(gh api "repos/$GITHUB_REPOSITORY/releases" --paginate \ --jq "[.[] | select(.tag_name==\"$TAG\")][0].id // empty")