Fix android tile issues #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: change | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
changelog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Generate | |
run: | | |
tags=($(git tag --merged $(git rev-parse HEAD) --sort=-creatordate)) | |
preTag=$(grep -oP '^## \K.*' CHANGELOG.md | head -n 1) | |
currentTag="" | |
for ((i = 0; i <= ${#tags[@]}; i++)); do | |
if (( i < ${#tags[@]} )); then | |
tag=${tags[$i]} | |
else | |
tag="" | |
fi | |
if [ -n "$currentTag" ]; then | |
if [ "$(echo -e "$currentTag\n$preTag" | sort -V | head -n 1)" == "$currentTag" ]; then | |
break | |
fi | |
fi | |
if [ -n "$currentTag" ]; then | |
echo "## $currentTag" >> CHANGELOG.md | |
echo "" >> CHANGELOG.md | |
if [ -n "$tag" ]; then | |
git log --pretty=format:"%B" "$tag..$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> CHANGELOG.md | |
else | |
git log --pretty=format:"%B" "$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> CHANGELOG.md | |
fi | |
echo "" >> CHANGELOG.md | |
fi | |
currentTag=$tag | |
done | |
- name: Commit | |
run: | | |
git add CHANGELOG.md | |
if ! git diff --cached --quiet; then | |
echo "Commit pushing" | |
git config --local user.email "[email protected]" | |
git config --local user.name "chen08209" | |
git commit -m "Update changelog" | |
git push | |
if [ $? -eq 0 ]; then | |
echo "Push succeeded" | |
else | |
echo "Push failed" | |
exit 1 | |
fi | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |