Skip to content

Commit

Permalink
ci: Added auto merge
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Aug 20, 2024
1 parent 19f97c9 commit 2aaadd3
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Auto-approve and auto-merge bot pull requests
on:
pull_request:
branches:
- main
- master

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: ${{ (github.actor == 'dependabot[bot]' || github.actor == 'HavenDV') && github.repository_owner == 'HavenDV' }}
steps:
- name: Dependabot metadata
if: ${{ github.actor == 'dependabot[bot]' }}
id: metadata
uses: dependabot/fetch-metadata@0fb21704c18a42ce5aa8d720ea4b912f5e6babef
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Show sender
run: echo ${{ github.event.pull_request.sender }}

- name: Show triggering_actor
run: echo ${{ github.triggering_actor }}

- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions H.Socket.IO.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
.github\workflows\main.yml = .github\workflows\main.yml
.github\workflows\pull-request.yml = .github\workflows\pull-request.yml
.github\workflows\auto-merge.yml = .github\workflows\auto-merge.yml
EndProjectSection
EndProject
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}"
Expand Down

0 comments on commit 2aaadd3

Please sign in to comment.