Skip to content

Commit

Permalink
Add auto approve for dependabot PRs (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
damyan authored Jan 23, 2024
1 parent f27a016 commit df2e764
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Dependabot auto-approve'

on: pull_request

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1

- uses: actions/checkout@v4

- name: Setup gh cli
uses: ksivamuthu/actions-setup-gh-cli@v2

- name: Approve a Dependabot 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 for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit df2e764

Please sign in to comment.