name: Auto Approve Dependabot PRs

on: pull_request

jobs:
  auto-update-dependabot:
    name: Auto-Approve and enable Auto-Merge for all Dependabot PRs
    runs-on: ubuntu-latest
    steps:
    - id: enable-automerge
      name: Enable Github Automerge
      if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
      uses: alexwilson/enable-github-automerge-action@1.0.0
      with:
        github-token: "${{ secrets.ORIGAMI_FOX_ACCESS_TOKEN }}"
    - id: auto-approve-dependabot
      uses: hmarr/auto-approve-action@v2.1.0
      if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
      with:
        github-token: "${{ secrets.ORIGAMI_FOX_ACCESS_TOKEN }}"
