Skip to content

Commit 0ebb36d

Browse files
committed
ci: Added auto merge.
1 parent a53eb0f commit 0ebb36d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/auto-merge.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Auto-approve and auto-merge bot pull requests
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
auto-merge:
13+
runs-on: ubuntu-latest
14+
if: ${{ (github.actor == 'dependabot[bot]' || github.actor == 'HavenDV') && github.repository_owner == 'HavenDV' }}
15+
steps:
16+
- name: Dependabot metadata
17+
if: ${{ github.actor == 'dependabot[bot]' }}
18+
id: metadata
19+
uses: dependabot/fetch-metadata@0fb21704c18a42ce5aa8d720ea4b912f5e6babef
20+
with:
21+
github-token: "${{ secrets.GITHUB_TOKEN }}"
22+
23+
- name: Show sender
24+
run: echo ${{ github.event.pull_request.sender }}
25+
26+
- name: Show triggering_actor
27+
run: echo ${{ github.triggering_actor }}
28+
29+
- name: Approve a PR
30+
run: gh pr review --approve "$PR_URL"
31+
env:
32+
PR_URL: ${{ github.event.pull_request.html_url }}
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Enable auto-merge
36+
run: gh pr merge --auto --merge "$PR_URL"
37+
env:
38+
PR_URL: ${{ github.event.pull_request.html_url }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)