Skip to content

Commit

Permalink
Update update-changelog.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
molanp authored Oct 27, 2024
1 parent 168df46 commit 92283f3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
run: |
if [ -f CHANGELOG.md ]; then
LAST_UPDATE=$(grep -m 1 "## " CHANGELOG.md | awk '{print $2}' | tr -d '[]')
git log --since="$LAST_UPDATE" --pretty=format:"%ad - (%h): %s (PR #%G)" --date=format:"%Y-%m-%d" > commits.txt || echo "No new commits"
git log --since="$LAST_UPDATE" --pretty=format:"- %s" > commits.txt || echo "No new commits"
else
# 如果没有 CHANGELOG.md,获取所有提交
git log --pretty=format:"%ad - (%h): %s (PR #%G)" --date=format:"%Y-%m-%d" --reverse > commits.txt || echo "No commits found"
# 直接获取所有提交,并确保格式正确
git log --pretty=format:"- %s" --reverse > commits.txt || echo "No commits found"
fi
if [[ -s commits.txt ]]; then
Expand All @@ -38,6 +38,7 @@ jobs:
echo "Commits=No new commits" >> $GITHUB_ENV
fi
- name: Update or create CHANGELOG.md
run: |
if [[ "$(echo ${{ env.Commits }})" != "No new commits" ]]; then
Expand Down

0 comments on commit 92283f3

Please sign in to comment.