Skip to content

Commit

Permalink
fix(release): enhance changelog generation to handle missing tags
Browse files Browse the repository at this point in the history
  • Loading branch information
0PandaDEV committed Dec 25, 2024
1 parent dc34912 commit 1417d35
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,18 @@ jobs:
id: release_body
run: |
VERSION="${{ needs.prepare.outputs.version }}"
echo "Debug: Listing tags"
git tag -l
echo "Debug: Getting latest tag"
git describe --tags --abbrev=0 || echo "No tags found"
echo "Debug: Generating changelog"
CHANGES=$(git log "$(git describe --tags --abbrev=0 2>/dev/null || echo HEAD^)" HEAD --pretty=format:"- %s" || echo "No changelog available")
# Get the most recent release tag (v* tags only)
LAST_TAG=$(git describe --match "v*" --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1` 2>/dev/null || echo "")
if [ -n "$LAST_TAG" ]; then
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 "$CHANGES"
Expand Down

0 comments on commit 1417d35

Please sign in to comment.