Skip to content

Commit

Permalink
bugfix(workflow): 修复changelog actions
Browse files Browse the repository at this point in the history
  • Loading branch information
HsiangNianian committed Aug 15, 2024
1 parent 62536c6 commit f84f521
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v*

jobs:
deploy:
Expand All @@ -15,30 +15,35 @@ 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 }}
tag: ${{ github.ref_name }}
useGitmojis: false
includeInvalidCommits: true
fromTag: ${{ github.ref_name }}
toTag: ${{ env.previousTag }}
writeToFile: true
reverseOrder: true
includeInvalidCommits: true
useGitmojis: false
excludeTypes: build,docs,other,style

- name: Create Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
draft: false
draft: true
makeLatest: true
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
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
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f84f521

Please sign in to comment.