fix(ci): pass tag range to git-cliff so release body covers current release only #74

Closed
sarman wants to merge 1 commits from fix/changelog-range-scope into master

View File

@ -138,8 +138,11 @@ jobs:
PREV_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' \
| grep -v "^${CURRENT_TAG}$" | head -1 || echo "")
if [ -n "$PREV_TAG" ]; then
git-cliff --config cliff.toml --tag "$CURRENT_TAG" --strip all > /tmp/release_body.md || true
# Generate full CHANGELOG.md from all tags
# Range arg limits git-cliff to commits between the two tags only.
# 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
else
echo "No previous tag found, generating from git commits"