From a1f6b675ccfe16fe0f515b8b011686b8638b8a79 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Thu, 11 Jul 2024 16:13:36 +0200 Subject: [PATCH] Switch PRs from dependabot to automerge if tests pass - PRs are not merged automatically, becaus PRs have to be reviewed by a human Signed-off-by: Robert Waffen --- .github/workflows/ci.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 080f4510..bb16a0e8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -74,3 +74,22 @@ jobs: name: Test suite steps: - run: echo Test suite completed + + dependabot: + name: 'Dependabot auto-merge' + needs: + - tests + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: '${{ secrets.GITHUB_TOKEN }}' + + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}