Skip to content

Commit 4b8ce64

Browse files
add auto merge
1 parent 0b9fc79 commit 4b8ce64

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

.github/workflows/auto-merge-pr.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
name: Post-Check Actions
2+
on: pull_request
23

3-
on:
4-
check_suite:
5-
types: [completed]
4+
permissions:
5+
contents: write
66

77
jobs:
8-
post_check_actions:
8+
dependabot-merge:
99
runs-on: ubuntu-latest
10-
if: ${{ contains(github.event.pull_request.base.ref, 'feature/update_cli') && github.event.check_suite.conclusion == 'success' }}
10+
if: ${{ contains(github.event.pull_request.base.ref, 'feature/update_cli') }}
1111
steps:
12-
- uses: hmarr/auto-approve-action@v4
12+
- name: Dependabot metadata
13+
id: metadata
14+
uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34 #v2.2.0
1315
with:
14-
review-message: "Auto approved automated PR"
15-
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
16-
pull-request-number: ${{ github.event.pull_request.number }}
16+
github-token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
17+
- name: Enable auto-merge for Dependabot PRs
18+
env:
19+
PR_URL: ${{github.event.pull_request.html_url}}
20+
GITHUB_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN }}
21+
run: gh pr merge --auto --merge "$PR_URL"
22+
- name: Auto approve dependabot PRs
23+
uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 #v4
24+
with:
25+
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)