# Automatically merge Dependabot PRs when version comparison is within the range
# that is configured in .github/auto-merge.yml

name: Auto-Merge Dependabot PRs

on:
  pull_request:

jobs:
  auto-merge:
	runs-on: ubuntu-latest
	steps:
	  - name: Checkout code
		uses: actions/checkout@v2

	  - name: Check if PR should be auto-merged
		uses: ahmadnassri/action-dependabot-auto-merge@v2
		with:
		  # This must be a personal access token with push access
		  github-token: ${{ secrets.AUTO_MERGE_TOKEN }}
		  # By default, squash and merge, so Github chooses nice commit messages
		  command: squash and merge
