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 13, 2024
1 parent d296a56 commit da2e141
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Auto-approve and auto-merge bot pull requests
on:
pull_request:
branches:
- main

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 }}

0 comments on commit da2e141

Please sign in to comment.