This commit is contained in:
subframe7536 2025-01-05 21:16:34 +08:00
parent 0d45482a5a
commit d3b4361027

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 | awk '1; END {print ""}' | tail -r)
CHANGELOG=$(git log --pretty=format:"- %s" "$PREV"..HEAD | awk '1; END {print ""}' | tac)
else
PREV=$(git tag --list --sort=committerdate | tail -n 2 | head -n 1)
CHANGELOG=$(git log --pretty=format:"- %s" "$PREV".."$TAG" | sed '1d' | awk '1; END {print ""}' | tail -r)
CHANGELOG=$(git log --pretty=format:"- %s" "$PREV".."$TAG" | sed '1d' | awk '1; END {print ""}' | tac)
fi
sed -i 's|<!-- changelog -->|'"${CHANGELOG//$'\n'/\\n}"'|' .github/release_template.md