From acc6f7abd9162b8710d576600ef3b8401b7a9aa6 Mon Sep 17 00:00:00 2001 From: Giovanni Marzot Date: Fri, 24 Jul 2026 09:25:11 -0400 Subject: [PATCH] version release: fix finalize isLatest check gh release view has no isLatest --json field (only gh release list does), so the Confirm release published step always exited 1 after the release was already live. Keep isPrerelease/name from release view and derive isLatest by comparing the tag against the releases/latest API, still without forcing --latest. Also tighten the stale finalize header comment. Port of openmoq/moxygen#331. Fixes #510 --- .github/workflows/version-release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/version-release.yml b/.github/workflows/version-release.yml index 5ff585f1..f7cc852d 100644 --- a/.github/workflows/version-release.yml +++ b/.github/workflows/version-release.yml @@ -454,8 +454,8 @@ jobs: xargs -0 -n1 -P 6 -I{} gh release upload "$TAG" --repo "$REPO" {} --clobber # ════════════════════════════════════════════════════════════════════════════ - # Finalize: mark release as latest once all uploads succeeded. - # Tolerates portable-build being skipped (has_portable=false). + # Finalize: confirm the release is fully published once all uploads + # succeeded. Tolerates portable-build being skipped (has_portable=false). # ════════════════════════════════════════════════════════════════════════════ finalize: @@ -487,4 +487,8 @@ jobs: # would mark a hotfix patch from a release/vM.m branch as # latest even when a newer vM.(m+1) line exists. echo "Released: $TAG" - gh release view "$TAG" --repo "$REPO" --json isLatest,isPrerelease,name --jq '"isLatest=\(.isLatest) isPrerelease=\(.isPrerelease) name=\(.name)"' + # isLatest is not a --json field on `gh release view` (only on + # `gh release list`), so derive it from the releases/latest API. + gh release view "$TAG" --repo "$REPO" --json isPrerelease,name --jq '"isPrerelease=\(.isPrerelease) name=\(.name)"' + LATEST=$(gh api "repos/$REPO/releases/latest" --jq .tag_name) + echo "isLatest=$([ "$LATEST" = "$TAG" ] && echo true || echo false) (latest=$LATEST)"