fix(ci): pass tag range to git-cliff so release body covers current release only
Some checks failed
PR Review Automation / review (pull_request) Has been cancelled
Test / frontend-typecheck (pull_request) Successful in 1m23s
Test / frontend-tests (pull_request) Successful in 1m24s
Test / rust-fmt-check (pull_request) Successful in 14m43s
Test / rust-clippy (pull_request) Successful in 17m58s
Test / rust-tests (pull_request) Successful in 19m40s

git-cliff's --tag flag sets a version label, it does not restrict which
commits are scanned. Without a positional range argument, git-cliff walks
the entire commit history and generates every historical release section,
producing a release body that contains the full changelog.

Pass "${PREV_TAG}..${CURRENT_TAG}" as the range argument so git-cliff only
processes commits introduced in the current release. The full CHANGELOG.md
generation is unchanged (no range — intentional, it covers all tags).
This commit is contained in:
Shaun Arman 2026-06-06 21:07:04 -05:00
parent f67821c0b8
commit b94f96d38f

View File

@ -138,8 +138,11 @@ jobs:
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 "")
if [ -n "$PREV_TAG" ]; then if [ -n "$PREV_TAG" ]; then
git-cliff --config cliff.toml --tag "$CURRENT_TAG" --strip all > /tmp/release_body.md || true # Range arg limits git-cliff to commits between the two tags only.
# Generate full CHANGELOG.md from all tags # Without it, git-cliff walks all history and dumps every release section.
git-cliff --config cliff.toml --tag "$CURRENT_TAG" --strip all \
"${PREV_TAG}..${CURRENT_TAG}" > /tmp/release_body.md || true
# Full CHANGELOG.md still covers all tags (no range — intentional)
git-cliff --config cliff.toml --output CHANGELOG.md git-cliff --config cliff.toml --output CHANGELOG.md
else else
echo "No previous tag found, generating from git commits" echo "No previous tag found, generating from git commits"