Skip to content

Commit 55dfd7f

Browse files
authored
version release: fix finalize isLatest check (#511)
1 parent 0f720c1 commit 55dfd7f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/version-release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ jobs:
454454
xargs -0 -n1 -P 6 -I{} gh release upload "$TAG" --repo "$REPO" {} --clobber
455455
456456
# ════════════════════════════════════════════════════════════════════════════
457-
# Finalize: mark release as latest once all uploads succeeded.
458-
# Tolerates portable-build being skipped (has_portable=false).
457+
# Finalize: confirm the release is fully published once all uploads
458+
# succeeded. Tolerates portable-build being skipped (has_portable=false).
459459
# ════════════════════════════════════════════════════════════════════════════
460460

461461
finalize:
@@ -487,4 +487,8 @@ jobs:
487487
# would mark a hotfix patch from a release/vM.m branch as
488488
# latest even when a newer vM.(m+1) line exists.
489489
echo "Released: $TAG"
490-
gh release view "$TAG" --repo "$REPO" --json isLatest,isPrerelease,name --jq '"isLatest=\(.isLatest) isPrerelease=\(.isPrerelease) name=\(.name)"'
490+
# isLatest is not a --json field on `gh release view` (only on
491+
# `gh release list`), so derive it from the releases/latest API.
492+
gh release view "$TAG" --repo "$REPO" --json isPrerelease,name --jq '"isPrerelease=\(.isPrerelease) name=\(.name)"'
493+
LATEST=$(gh api "repos/$REPO/releases/latest" --jq .tag_name)
494+
echo "isLatest=$([ "$LATEST" = "$TAG" ] && echo true || echo false) (latest=$LATEST)"

0 commit comments

Comments
 (0)