fix(ci): verify tag exists locally before running git-cliff
All checks were successful
Test / rust-fmt-check (pull_request) Successful in 1m42s
Test / rust-clippy (pull_request) Successful in 3m31s
Test / frontend-typecheck (pull_request) Successful in 2m40s
Test / frontend-tests (pull_request) Successful in 1m54s
Test / rust-tests (pull_request) Successful in 4m23s
PR Review Automation / review (pull_request) Successful in 6m15s

Addresses the review warning: git rev-parse confirms the tag is
present in the local repo after git fetch --tags before git-cliff
or git tag --sort= runs against it. Fails fast with a clear error
if the tag is missing rather than silently generating an incomplete
changelog.
This commit is contained in:
Shaun Arman 2026-05-31 16:05:18 -05:00
parent cc99aa815b
commit 7ee4f58bfd

View File

@ -128,6 +128,13 @@ jobs:
# Use the tag output from autotag — never rely on git describe # Use the tag output from autotag — never rely on git describe
CURRENT_TAG="${RELEASE_TAG}" CURRENT_TAG="${RELEASE_TAG}"
echo "Building changelog for $CURRENT_TAG" echo "Building changelog for $CURRENT_TAG"
# Verify the tag is present locally after fetch before running git-cliff
if ! git rev-parse "refs/tags/${CURRENT_TAG}" >/dev/null 2>&1; then
echo "ERROR: tag ${CURRENT_TAG} not found locally after fetch"
exit 1
fi
git-cliff --config cliff.toml --output CHANGELOG.md git-cliff --config cliff.toml --output CHANGELOG.md
PREV_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' \ PREV_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' \
| grep -v "^${CURRENT_TAG}$" | head -1 || echo "") | grep -v "^${CURRENT_TAG}$" | head -1 || echo "")