Skip to content

Commit 72f6e03

Browse files
committed
chore(ci): add changelog.yml workflow
1 parent 381834c commit 72f6e03

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/changelog.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Update CHANGELOG
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
jobs:
9+
changelog:
10+
name: Update CHANGELOG
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
if: "!startsWith(github.event.head_commit.message, '[Release]')"
14+
steps:
15+
- uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 0
18+
- uses: jdx/mise-action@v3
19+
with:
20+
experimental: true
21+
- name: Generate CHANGELOG.md
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: git cliff --config ./cliff.toml -o ./CHANGELOG.md
25+
- name: Check for CHANGELOG changes
26+
id: changelog-changes
27+
run: |
28+
if git diff --quiet CHANGELOG.md; then
29+
echo "No changes in CHANGELOG.md"
30+
echo "has-changes=false" >> $GITHUB_OUTPUT
31+
else
32+
echo "CHANGELOG.md has changes"
33+
echo "has-changes=true" >> $GITHUB_OUTPUT
34+
fi
35+
- name: Commit CHANGELOG
36+
uses: stefanzweifel/git-auto-commit-action@v7
37+
if: steps.changelog-changes.outputs.has-changes == 'true'
38+
with:
39+
commit_message: "docs: update CHANGELOG.md"
40+
file_pattern: CHANGELOG.md

0 commit comments

Comments
 (0)