Skip to content

Commit 3a7f50e

Browse files
committed
Automate merge changelog PR
1 parent d96638b commit 3a7f50e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/update-changelog.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
workflow_dispatch: # Allows manual trigger
77

88
permissions:
9-
contents: write # Minimum required permission for file changes and PR creation
10-
pull-requests: write # Required for creating PRs
9+
contents: write # Required for file changes and auto-merge
10+
pull-requests: write # Required for creating PRs and auto-merge
1111

1212
jobs:
1313
update-changelog:
@@ -49,6 +49,7 @@ jobs:
4949
- name: Create Pull Request
5050
if: steps.generate.outputs.changes == 'true'
5151
uses: peter-evans/create-pull-request@v4
52+
id: create-pr
5253
with:
5354
token: ${{ secrets.GITHUB_TOKEN }}
5455
commit-message: "chore: update CHANGELOG.md"
@@ -58,9 +59,17 @@ jobs:
5859
5960
- Generated using git-chglog
6061
- Triggered by: ${{ github.event_name }}
62+
- Auto-merge enabled
6163
branch: update-changelog-${{ github.run_id }}
6264
base: main
63-
delete-branch: true
65+
delete-branch: true # This will delete the branch after merge
6466
labels: |
6567
documentation
6668
automated-pr
69+
70+
- name: Enable Auto-merge
71+
if: steps.generate.outputs.changes == 'true'
72+
run: |
73+
gh pr merge --auto --merge "${{ steps.create-pr.outputs.pull-request-number }}"
74+
env:
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)