From 7ee4f58bfd8eac5099aad04650d906b73f51b80c Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Sun, 31 May 2026 16:05:18 -0500 Subject: [PATCH] fix(ci): verify tag exists locally before running git-cliff 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. --- .gitea/workflows/auto-tag.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitea/workflows/auto-tag.yml b/.gitea/workflows/auto-tag.yml index c4d38bb0..72b47f0e 100644 --- a/.gitea/workflows/auto-tag.yml +++ b/.gitea/workflows/auto-tag.yml @@ -128,6 +128,13 @@ jobs: # Use the tag output from autotag — never rely on git describe CURRENT_TAG="${RELEASE_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 PREV_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' \ | grep -v "^${CURRENT_TAG}$" | head -1 || echo "")