Improve auto-release to include commit notes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
kk K
2026-04-19 17:33:25 +08:00
parent c94acdf5dc
commit 993836fea4

View File

@@ -37,12 +37,24 @@ jobs:
fi
echo "tag=$NEXT_TAG" >> $GITHUB_OUTPUT
- name: Generate release notes
id: release_notes
run: |
# Get commit messages since last tag
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -z "$LAST_TAG" ]; then
NOTES=$(git log --oneline -10)
else
NOTES=$(git log $LAST_TAG..HEAD --oneline)
fi
echo "notes=$(echo "$NOTES" | sed 's/^/- /')" >> $GITHUB_OUTPUT
- name: Create or Update Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.generate_tag.outputs.tag }}
name: "Release ${{ steps.generate_tag.outputs.tag }}"
body: "Auto-generated release for the latest commit."
allowUpdates: false
body: "${{ steps.release_notes.outputs.notes }}"
allowUpdates: true
makeLatest: true
token: ${{ secrets.GITHUB_TOKEN }}