name: Dependabot Auto Merge on: pull_request: types: - opened - synchronize - reopened - labeled permissions: contents: write pull-requests: write jobs: enable-automerge: if: github.event.pull_request.user.login == 'dependabot[bot]' runs-on: ubuntu-latest timeout-minutes: 10 steps: - name: Fetch Dependabot metadata id: metadata uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 with: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Enable auto-merge for patch updates if: | (github.event.pull_request.base.ref == 'main') && ( steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'security:update' ) run: gh pr merge --auto --merge "$PR_URL" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_URL: ${{ github.event.pull_request.html_url }}