name: Automerge

# Enable while working on this file
on:
  push:
    paths: 
      - "automerge.yaml"

# Enable to automerge the daily data updates
# on:
#   pull_request:
#     types:
#       - labeled
#   check_suite:
#     types:
#       - completed

jobs:
  automerge:
    runs-on: ubuntu-latest
    steps:
      - name: automerge
        uses: pascalgn/automerge-action@v0.9.0
        env:
          # FIXME: This probably needs to be a Personal Access Token
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
          MERGE_FILTER_AUTHOR: "dependabot" # Restrict automerge to the "dependabot" user
          MERGE_FORKS: false
          MERGE_DELETE_BRANCH: true
name: Automerge

# Enable while working on this file
on:
  push:
    paths: 
      - "automerge.yaml"

# Approach #1, via pascalgn/automerge-action
# ###
# Enable to automerge the daily data updates
# on:
#   pull_request:
#     types:
#       - labeled
#   check_suite:
#     types:
#       - completed

# jobs:
#   automerge:
#     runs-on: ubuntu-latest
#     steps:
#       - name: automerge
#         uses: pascalgn/automerge-action@v0.9.0
#         env:
#           # FIXME: This probably needs to be a Personal Access Token
#           GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
#           MERGE_FILTER_AUTHOR: "dependabot" # Restrict automerge to the "dependabot" user
#           MERGE_FORKS: false
#           MERGE_DELETE_BRANCH: true

# Approach #2, via https://github.com/dependabot/dependabot-core/issues/1973#issuecomment-701889737
if: github.actor == 'dependabot[bot]'
  steps:
    - name: automerge
      uses: actions/github-script@v3
      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 }}

Add an alternative approach, for discussion
Add an alternative approach, for discussion
