-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1.12 KB
/
generate-changelog.yaml
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
name: Generate CHANGELOG
on:
pull_request:
types: [closed]
workflow_dispatch:
jobs:
GenerateChangelog:
if: github.event.pull_request.merged || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
submodules: true
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go install github.com/hashicorp/go-changelog/cmd/changelog-build@latest
- run: ./.github/changelog/generate-changelog.sh
- run: |
if [[ `git status --porcelain` ]]; then
if ${{github.event_name == 'workflow_dispatch'}}; then
MSG="chore: update CHANGELOG.md (Manual Trigger)"
else
MSG="chore: update CHANGELOG.md for #${{ github.event.pull_request.number }}"
fi
git config --local user.email changelogbot@frangipane.io
git config --local user.name changelogbot
git add CHANGELOG.md
git commit -m "$MSG"
git push
fi