Skip to content

Commit

Permalink
Add dependabot automerge workflow
Browse files Browse the repository at this point in the history
This will ensure that minor/patch version changes will be automatically
merged, reducing the effort required to keep dependencies up to date
  • Loading branch information
Tabby committed Sep 24, 2024
1 parent 7e75d2c commit 53a4595
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Dependabot Auto Merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

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

0 comments on commit 53a4595

Please sign in to comment.