update changelog in release ci

This commit is contained in:
subframe7536 2024-12-29 11:58:36 +08:00
parent 6265a15dc6
commit 442bb22f07

View file

@ -61,10 +61,10 @@ jobs:
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
TAG="v$(date +%s)"
PREV=$(git tag --list --sort=committerdate | tail -n 1)
CHANGELOG=$(git log --pretty=format:"- %s" "$PREV"..HEAD)
CHANGELOG=$(git log --pretty=format:"- %s" "$PREV"..HEAD | awk '1; END {print ""}' | tail -r)
else
PREV=$(git tag --list --sort=committerdate | tail -n 2 | head -n 1)
CHANGELOG=$(git log --pretty=format:"- %s" "$PREV".."$TAG")
CHANGELOG=$(git log --pretty=format:"- %s" "$PREV".."$TAG" | sed '1d' | awk '1; END {print ""}' | tail -r)
fi
sed -i 's|<!-- changelog -->|'"${CHANGELOG//$'\n'/\\n}"'|' .github/release_template.md