Skip to content

Commit

Permalink
Merge pull request #470 from ruby/automerge
Browse files Browse the repository at this point in the history
Try to use dependabot automerge
  • Loading branch information
hsbt committed Feb 14, 2023
2 parents fab05f5 + a2e2824 commit 9a4c9c9
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/dependabot_automerge.yml
@@ -0,0 +1,41 @@
# from https://github.com/gofiber/swagger/blob/main/.github/workflows/dependabot_automerge.yml
name: Dependabot auto-merge
on:
pull_request

permissions:
contents: write
pull-requests: write

jobs:
wait_for_checks:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Wait for check is finished
uses: lewagon/wait-on-check-action@v1.2.0
id: wait_for_checks
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
running-workflow-name: wait_for_checks
check-regexp: test
repo-token: ${{ secrets.MATZBOT_GITHUB_TOKEN }}
wait-interval: 10
dependabot:
needs: [wait_for_checks]
name: Dependabot auto-merge
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.6
with:
github-token: "${{ secrets.MATZBOT_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 --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.MATZBOT_GITHUB_TOKEN}}

0 comments on commit 9a4c9c9

Please sign in to comment.