fix(ci): generate per-release changelog body using positional range arg

git-cliff's --tag flag sets the display label for unreleased commits;
it does not scope commits to a range. Passing a range string to --tag
caused git-cliff to emit the full cumulative history for every release.

Move the revision range from --tag to a positional argument so only
commits between PREV_TAG and CURRENT_TAG appear in each release body.
CHANGELOG.md generation is unaffected (still full history).
This commit is contained in:
Shaun Arman 2026-06-07 17:05:16 -05:00
parent 316f5250b6
commit bbaa2cc8ae

View File

@ -138,8 +138,8 @@ 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
# Generate changelog for current tag only using tag range # Generate release body for this tag only (commits since previous tag)
git-cliff --config cliff.toml --tag "${PREV_TAG}..${CURRENT_TAG}" > /tmp/release_body.md || true git-cliff --config cliff.toml "${PREV_TAG}..${CURRENT_TAG}" > /tmp/release_body.md || true
# Generate full CHANGELOG.md from all tags # Generate full CHANGELOG.md from all tags
git-cliff --config cliff.toml --output CHANGELOG.md git-cliff --config cliff.toml --output CHANGELOG.md
else else