Skip to content

Dependabot Automerge #724

Dependabot Automerge

Dependabot Automerge #724

name: "Dependabot Automerge"
on:
workflow_run:
workflows: ["CI Build"]
types:
- completed
jobs:
automerge:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.actor == 'dependabot[bot]' }}
steps:
- uses: actions/github-script@v5
env:
pull_request_number: ${{ toJSON(github.event.workflow_run.pull_requests[0].number) }}
with:
script: |
github.rest.pulls.createReview({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: ${{env.pull_request_number}},
event: 'APPROVE'
})
github.rest.pulls.merge({
owner: context.payload.repository.owner,
repo: context.payload.repository.name,
pull_number: ${{env.pull_request_number}},
})