Skip to content

Commit

Permalink
cache
Browse files Browse the repository at this point in the history
  • Loading branch information
chen08209 committed Oct 10, 2024
1 parent f539b1b commit 30c16d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 123 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,24 @@ jobs:
- name: Generate
run: |
tags=$(git tag --merged $(git rev-parse HEAD) --sort=-creatordate)
lastTag = ""
previous = ""
if [ -f CHANGELOG.md ]; then
previous=$(grep -oP '^## \K.*' CHANGELOG.md | head -n 1)
lastTag=$(grep -oP '^## \K.*' CHANGELOG.md | head -n 1)
previous = lastTag
fi
for tag in $tags; do
if [ "$tag" == "$previous" ]; then
if [ -n "$lastTag" ] && [ "$(echo -e "$tag\n$lastTag" | sort -V | head -n 1)" == "$tag" ]; then
break
fi
echo "## $tag" >> NEW_CHANGELOG.md
echo "" >> NEW_CHANGELOG.md
git log --pretty=format:"%B" "$tag..$previous" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md
echo "" >> NEW_CHANGELOG.md
if [ -z "$previous" ]; then
break;
git log --pretty=format:"%B" "$tag.." | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md
else
git log --pretty=format:"%B" "$tag..$previous" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md
fi
echo "" >> NEW_CHANGELOG.md
previous=$tag
done
if [ -f CHANGELOG.md ]; then
Expand Down
118 changes: 0 additions & 118 deletions CHANGELOG.md

This file was deleted.

0 comments on commit 30c16d3

Please sign in to comment.