diff --git a/.github/workflows/dependabot.auto.yml b/.github/workflows/dependabot.auto.yml index 4df91b9..271e5eb 100644 --- a/.github/workflows/dependabot.auto.yml +++ b/.github/workflows/dependabot.auto.yml @@ -4,24 +4,13 @@ on: pull_request: jobs: - worker: + dependabot: + name: 'Dependabot' runs-on: ubuntu-latest - - if: github.actor == 'dependabot[bot]' + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} steps: - - name: automerge - uses: actions/github-script@0.2.0 - with: - script: | - github.pullRequests.createReview({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - pull_number: context.payload.pull_request.number, - event: 'APPROVE' - }) - github.pullRequests.merge({ - owner: context.payload.repository.owner.login, - repo: context.payload.repository.name, - pull_number: context.payload.pull_request.number - }) - github-token: ${{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.TOKEN_GITHUB}}