forked from hashicorp/terraform-provider-awscc
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.4 KB
/
generate_changelog.yml
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
name: Generate CHANGELOG
on:
pull_request:
types: [closed]
workflow_dispatch:
jobs:
go-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.go-version.outputs.version }}
steps:
- uses: actions/checkout@v2
- id: go-version
run: echo "::set-output name=version::$(cat ./.go-version)"
GenerateChangelog:
needs: [go-version]
if: github.event.pull_request.merged || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: ${{ needs.go-version.outputs.version }}
- run: go get github.com/miniscruff/changie
- run: |
changie batch $(changie latest)
changie merge
if [[ `git status --porcelain` ]]; then
if ${{github.event_name == 'workflow_dispatch'}}; then
MSG="Update CHANGELOG.md (Manual Trigger)"
else
MSG="Update CHANGELOG.md for #${{ github.event.pull_request.number }}"
fi
git config --local user.email [email protected]
git config --local user.name changelogbot
# ignore files deleted after `changie batch`
git add CHANGELOG.md .changelog/$(changie latest).md
git commit -m "$MSG"
git push
fi