Skip to content

Commit 04a0a66

Browse files
authored
Refactor changelog workflow for auto generation
1 parent d9d8592 commit 04a0a66

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

.github/workflows/changelog.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
1-
name: Update Changelog
1+
name: Auto Changelog
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
tags:
6+
- "v*"
67

78
permissions:
89
contents: write
910

1011
jobs:
1112
changelog:
13+
name: Generate CHANGELOG.md
1214
runs-on: ubuntu-latest
1315

1416
steps:
15-
- name: Checkout
17+
- name: Checkout repository
1618
uses: actions/checkout@v4
17-
18-
- name: Update CHANGELOG.md
19-
uses: stefanzweifel/changelog-updater-action@v1
2019
with:
21-
latest-version: ${{ github.event.release.tag_name }}
22-
release-notes: ${{ github.event.release.body }}
20+
fetch-depth: 0
21+
22+
- name: Install auto-changelog
23+
run: npm install -g auto-changelog
24+
25+
- name: Generate changelog
26+
run: |
27+
auto-changelog \
28+
--output CHANGELOG.md \
29+
--template keepachangelog \
30+
--commit-limit 100
2331
2432
- name: Commit changelog
25-
uses: stefanzweifel/git-auto-commit-action@v5
26-
with:
27-
commit_message: "docs(changelog): update for ${{ github.event.release.tag_name }}"
28-
file_pattern: CHANGELOG.md
33+
run: |
34+
git config user.name "github-actions"
35+
git config user.email "github-actions@github.com"
36+
git add CHANGELOG.md
37+
git commit -m "docs: update changelog for ${{ github.ref_name }}" || echo "No changes"
38+
git push

0 commit comments

Comments
 (0)