Skip to content

Commit

Permalink
Adds automerge script
Browse files Browse the repository at this point in the history
  • Loading branch information
joergi committed Jun 13, 2024
1 parent 6e6e9de commit db21d47
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ updates:
interval: daily
time: '04:00'
open-pull-requests-limit: 100
labels:
- "dependencies"
- "automerge"
28 changes: 28 additions & 0 deletions .github/workflows/auto-merge-dependabot-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Enables auto-merge on dependency pull requests
on:
pull_request:
branches:
- main
workflow_dispatch: {}

jobs:
enable-automerge:
if: |
contains(github.event.pull_request.labels.*.name, 'automerge')
&&
contains(github.event.pull_request.labels.*.name, 'dependencies')
&& (
contains(github.event.pull_request.labels.*.name, 'minor')
|| contains(github.event.pull_request.labels.*.name, 'patch')
)
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Enable auto-merge
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 db21d47

Please sign in to comment.