Skip to content

Commit

Permalink
automating merge for dependabot PRs (#326)
Browse files Browse the repository at this point in the history
Co-authored-by: kyleclark171 <[email protected]>
  • Loading branch information
kyleclark171 and kyleclark171 authored Jul 19, 2023
1 parent 194fd75 commit 2bbfac6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/automerge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on: pull_request_target

permissions:
contents: write
pull-requests: write

jobs:
automerge-dependabot-prs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Approve Dependabot PRs
run: gh pr review --approve --body "Auto-approving Dependabot PRs" "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 2bbfac6

Please sign in to comment.