Skip to content

Commit 9a4c9c9

Browse files
authored
Merge pull request #470 from ruby/automerge
Try to use dependabot automerge
2 parents fab05f5 + a2e2824 commit 9a4c9c9

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# from https://github.com/gofiber/swagger/blob/main/.github/workflows/dependabot_automerge.yml
2+
name: Dependabot auto-merge
3+
on:
4+
pull_request
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
jobs:
11+
wait_for_checks:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.actor == 'dependabot[bot]' }}
14+
steps:
15+
- name: Wait for check is finished
16+
uses: lewagon/wait-on-check-action@v1.2.0
17+
id: wait_for_checks
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
20+
running-workflow-name: wait_for_checks
21+
check-regexp: test
22+
repo-token: ${{ secrets.MATZBOT_GITHUB_TOKEN }}
23+
wait-interval: 10
24+
dependabot:
25+
needs: [wait_for_checks]
26+
name: Dependabot auto-merge
27+
runs-on: ubuntu-latest
28+
if: ${{ github.actor == 'dependabot[bot]' }}
29+
steps:
30+
- name: Dependabot metadata
31+
id: metadata
32+
uses: dependabot/fetch-metadata@v1.3.6
33+
with:
34+
github-token: "${{ secrets.MATZBOT_GITHUB_TOKEN }}"
35+
- name: Enable auto-merge for Dependabot PRs
36+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
37+
run: |
38+
gh pr merge --auto --merge "$PR_URL"
39+
env:
40+
PR_URL: ${{github.event.pull_request.html_url}}
41+
GITHUB_TOKEN: ${{secrets.MATZBOT_GITHUB_TOKEN}}

0 commit comments

Comments
 (0)