Skip to content

Commit

Permalink
Add generate-changelog job
Browse files Browse the repository at this point in the history
  • Loading branch information
Nmishin committed Jan 22, 2024
1 parent 2247c74 commit 64d9d0d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Generate CHANGELOG
on:
pull_request_target:
types: [closed]
workflow_run:
workflows: [Generate registry documentation]
types:
- completed
workflow_dispatch:
jobs:
generate-changelog:
if: github.event.pull_request.merged || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: cd tools && go install github.com/hashicorp/go-changelog/cmd/changelog-build
- run: ./scripts/generate-changelog.sh
- run: |
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 changelogbot@cloudflare.com
git config --local user.name changelogbot
git add CHANGELOG.md
git commit -m "$MSG"
git push
fi

0 comments on commit 64d9d0d

Please sign in to comment.