name: Dependabot Auto-merge on: pull_request: types: - opened - synchronize - reopened permissions: contents: write pull-requests: write jobs: dependabot-automation: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} timeout-minutes: 13 steps: - name: Dependabot metadata id: metadata uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Approve & enable auto-merge for Dependabot PR if: | steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' run: | gh pr merge --auto -s "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} PR_TITLE: ${{ github.event.pull_request.title }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}