Skip to content

Auto approve bot

Auto approve bot #414

Workflow file for this run

# Auto approve pull requests with auto-approve label
name: Auto approve bot
on:
# Only trigger, when the CI workflow succeeded
workflow_run:
workflows: [ "CI" ]
types:
- completed
permissions:
pull-requests: write
contents: write
jobs:
auto-approve:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'auto-approve')
&& github.actor == 'dependabot[bot]'
&& github.event.sender.login == 'dependabot[bot]'
&& github.event.sender.type == 'Bot'
steps:
- name: auto approve
uses: actions/[email protected]
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: "${{ secrets.GITHUB_TOKEN }}"