Skip to content

Commit 2aaadd3

Browse files
committed
ci: Added auto merge
1 parent 19f97c9 commit 2aaadd3

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/auto-merge.yml

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

H.Socket.IO.sln

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1717
README.md = README.md
1818
.github\workflows\main.yml = .github\workflows\main.yml
1919
.github\workflows\pull-request.yml = .github\workflows\pull-request.yml
20+
.github\workflows\auto-merge.yml = .github\workflows\auto-merge.yml
2021
EndProjectSection
2122
EndProject
2223
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.Socket.IO.IntegrationTests", "src\tests\H.Socket.IO.IntegrationTests\H.Socket.IO.IntegrationTests.csproj", "{4FA3F702-22E4-4D6C-8392-EB82C4FEF21D}"

0 commit comments

Comments
 (0)