Skip to content

Commit

Permalink
Merge pull request #894 from application-research/neelvirdy-patch-1
Browse files Browse the repository at this point in the history
Auto-merge dependabot PRs if checks pass
  • Loading branch information
neelvirdy authored Jan 24, 2023
2 parents 74d255a + 429b559 commit 3507e34
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ updates:
target-branch: "dev"
labels:
- "gomod dependencies"
reviewers:
- "neelvirdy"
27 changes: 27 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .github/workflows/automerge.yml

name: Dependabot auto-merge

on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
# GitHub provides this variable in the CI env. You don't
# need to add anything to the secrets vault.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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}}

0 comments on commit 3507e34

Please sign in to comment.