diff --git a/.github/workflows/dependabot-auto-maintenance.yml b/.github/workflows/dependabot-auto-maintenance.yml new file mode 100644 index 0000000..24b46c8 --- /dev/null +++ b/.github/workflows/dependabot-auto-maintenance.yml @@ -0,0 +1,21 @@ +name: Dependabot Auto-Maintenance +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + if: github.actor == 'dependabot[bot]' && startsWith(github.event.pull_request.head.ref, 'dependabot/') + runs-on: ubuntu-latest + steps: + - name: Enable auto-merge for safe dependency updates + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR: ${{ github.event.pull_request.number }} + run: | + set -euo pipefail + gh pr merge "$PR" --auto --squash --repo "$GITHUB_REPOSITORY"