diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 04ceb6e8..159c96d4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,5 +2,6 @@ version: 2 updates: - package-ecosystem: "maven" directory: "/" + open-pull-requests-limit: 10 schedule: - interval: "weekly" + interval: "daily" diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 00000000..f4e7e936 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,32 @@ +name: Auto-merge Dependabot PRs + +on: + pull_request_target: + types: [opened, reopened, synchronize, ready_for_review, labeled] + +jobs: + automerge: + if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: read + steps: + - name: Fetch Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Approve PR + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr review --approve "$PR_URL" + + - name: Enable auto-merge + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr merge --auto --squash "$PR_URL"