Skip to content

Auto approve and merge PRs by dependabot #8719

Auto approve and merge PRs by dependabot

Auto approve and merge PRs by dependabot #8719

name: Auto approve and merge PRs by dependabot
on:
workflow_run:
workflows: ["Tests"]
types:
- completed
jobs:
autoapprove:
name: Auto Approve a PR by dependabot
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- name: Auto approve
uses: hmarr/auto-approve-action@v2.4.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
automerge:
name: Auto merge after successful checks
# By default, jobs run in parallel. To run the jobs sequentially, they keywords "needs" is needed.
# Auto merge action can be done only when the PR is approved, hence this automerge needs autoapprove as a prerequisite
needs: autoapprove
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- name: Auto merge
uses: pascalgn/automerge-action@a58470325a3437bd872dace642422916828208e0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_LABELS: dependencies
MERGE_METHOD: rebase
MERGE_RETRIES: 100
MERGE_RETRY_SLEEP: 300000