Skip to content

Commit

Permalink
Merge pull request #111 from github/kh-auto-approve-and-merge
Browse files Browse the repository at this point in the history
Auto approve and merge dependabot updates
  • Loading branch information
khiga8 authored Sep 29, 2023
2 parents b4ba76b + 8ceb930 commit 85c5ece
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/auto-approve-and-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Auto-approve and merge PR
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
auto_approve:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Approve PR
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.pulls.createReview({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
event: "APPROVE",
})
- name: Enable auto-merge for PR
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 85c5ece

Please sign in to comment.