-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (46 loc) · 1.51 KB
/
changelog.yml
File metadata and controls
46 lines (46 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: update-changelog
on:
push:
branches:
- main
permissions:
contents: write
jobs:
changelog:
name: Update CHANGELOG
runs-on: ubuntu-latest
timeout-minutes: 15
if: |
!startsWith(github.event.head_commit.message, '[Release]') &&
!startsWith(github.event.head_commit.message, 'chore(changelog): update CHANGELOG.md') &&
github.event.head_commit.author.name != 'github-actions[bot]'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: jdx/mise-action@v3
with:
experimental: true
- name: Generate CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git cliff --config ./cliff.toml -o ./CHANGELOG.md
- name: Check for CHANGELOG changes
id: changelog-changes
run: |
if git diff --quiet CHANGELOG.md; then
echo "No changes in CHANGELOG.md"
echo "has-changes=false" >> $GITHUB_OUTPUT
else
echo "CHANGELOG.md has changes"
echo "has-changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v7
if: steps.changelog-changes.outputs.has-changes == 'true'
with:
commit_message: "chore(changelog): update CHANGELOG.md"
commit_options: '--no-verify'
file_pattern: CHANGELOG.md
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com