From e043da8b89847a2870396ff394c719eac543605c Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Wed, 29 Apr 2026 20:59:40 -0500 Subject: [PATCH] fix(auto-tag): use correct tag range for release notes --- .gitea/workflows/auto-tag.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/auto-tag.yml b/.gitea/workflows/auto-tag.yml index efeed982..e3893e0a 100644 --- a/.gitea/workflows/auto-tag.yml +++ b/.gitea/workflows/auto-tag.yml @@ -102,17 +102,16 @@ jobs: run: | set -eu git-cliff --config cliff.toml --output CHANGELOG.md - git-cliff --config cliff.toml --latest --strip all > /tmp/release_body.md - echo "=== Release body preview (from CHANGELOG) ===" - cat /tmp/release_body.md - # If release body is empty, generate from git commits - if [ ! -s /tmp/release_body.md ]; then - echo "=== Release body is empty, generating from git commits ===" - LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - git log "${LAST_TAG}..HEAD" --pretty=format:"- %s" > /tmp/release_body.md || true - echo "=== Release body preview (from commits) ===" - cat /tmp/release_body.md + CURRENT_TAG=$(git describe --tags --abbrev=0) + PREV_TAG=$(git describe --tags --abbrev=0 --match 'v*' --exclude "${CURRENT_TAG}" 2>/dev/null || echo "") + if [ -n "$PREV_TAG" ]; then + git-cliff --config cliff.toml --tag "$CURRENT_TAG" --strip all > /tmp/release_body.md || true + else + echo "=== No previous tag found, generating from git commits ===" + git log --pretty=format:"- %s" > /tmp/release_body.md || true fi + echo "=== Release body preview ===" + cat /tmp/release_body.md - name: Update Gitea release body env: