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 1ae2dc7 commit 168df46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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:"%ad - (%h): %s (PR #%G)" --date=format:"%Y-%m-%d" > commits.txt || echo "No new commits"
else
# 如果没有 CHANGELOG.md,获取所有提交
git log --pretty=format:"%ad - %h: %s (PR #%G)" --date=format:"%Y-%m-%d" > commits.txt || echo "No commits found"
git log --pretty=format:"%ad - (%h): %s (PR #%G)" --date=format:"%Y-%m-%d" --reverse > commits.txt || echo "No commits found"
fi
if [[ -s commits.txt ]]; then
Expand Down Expand Up @@ -59,11 +59,11 @@ jobs:
print commits[dates[i]];
print "";
}
}' >> CHANGELOG.md
}' >> CHANGELOG.md # 直接追加到 CHANGELOG.md
fi
- name: Commit and Push Changes
run: |
git add CHANGELOG.md
git commit -m "Update CHANGELOG.md with latest commits $(git rev-parse --short HEAD)" || echo "No changes to commit"
git commit -m "Update CHANGELOG.md with latest commits $(git rev-parse --short HEAD) (PR #${{ github.event.pull_request.number }})" || echo "No changes to commit"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/Passer1072/RookieAI_yolov8 HEAD:dev

0 comments on commit 168df46

Please sign in to comment.