# Approves and merges Dependabot's pull requests. It trusts github.actor,
# which is whoever acted on the pull request last.
name: Auto-merge Dependabot

on: pull_request_target

permissions:
  contents: write
  pull-requests: write

jobs:
  merge:
    if: github.actor == 'dependabot[bot]'
    runs-on: ubuntu-latest
    steps:
      - run: gh pr merge --auto --squash "$PR_URL"
        env:
          PR_URL: ${{ github.event.pull_request.html_url }}
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
