Skip to content

Commit

Permalink
chore(工作流): 优化工作流获取提交的记录方式
Browse files Browse the repository at this point in the history
  • Loading branch information
HsiangNianian committed Aug 15, 2024
1 parent b8bd9b2 commit 0ce9d0e
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,13 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get previous tag
id: previousTag
run: |
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
echo "previousTag: $name"
echo "previousTag=$name" >> $GITHUB_ENV

- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
fromTag: ${{ github.ref_name }}
toTag: ${{ env.previousTag }}
tag: ${{ github.ref_name }}
writeToFile: true
reverseOrder: true
includeInvalidCommits: true
Expand All @@ -41,8 +31,15 @@ jobs:
uses: ncipollo/[email protected]
with:
allowUpdates: true
draft: true
draft: false
makeLatest: true
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ github.token }}

- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
file_pattern: CHANGELOG.md

0 comments on commit 0ce9d0e

Please sign in to comment.