fix(release): enhance changelog generation to handle missing tags

This commit is contained in:
PandaDEV 2024-12-25 21:31:26 +10:00
parent dc34912895
commit 1417d35cd7
No known key found for this signature in database
GPG key ID: 13EFF9BAF70EE75C

View file

@ -243,12 +243,18 @@ jobs:
id: release_body id: release_body
run: | run: |
VERSION="${{ needs.prepare.outputs.version }}" VERSION="${{ needs.prepare.outputs.version }}"
echo "Debug: Listing tags"
git tag -l # Get the most recent release tag (v* tags only)
echo "Debug: Getting latest tag" LAST_TAG=$(git describe --match "v*" --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1` 2>/dev/null || echo "")
git describe --tags --abbrev=0 || echo "No tags found"
echo "Debug: Generating changelog" if [ -n "$LAST_TAG" ]; then
CHANGES=$(git log "$(git describe --tags --abbrev=0 2>/dev/null || echo HEAD^)" HEAD --pretty=format:"- %s" || echo "No changelog available") echo "Debug: Found last release tag: $LAST_TAG"
CHANGES=$(git log ${LAST_TAG}..HEAD --pretty=format:"- %s")
else
echo "Debug: No previous release tag found, using first commit"
CHANGES=$(git log --pretty=format:"- %s")
fi
echo "Debug: Changelog content:" echo "Debug: Changelog content:"
echo "$CHANGES" echo "$CHANGES"