diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e2379a0..c327a78 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,15 @@ version: 2 + +multi-ecosystem-groups: + infrastructure: + schedule: + interval: "weekly" + day: "wednesday" + open-pull-requests-limit: 25 + commit-message: + prefix: "chore" + include: "scope" + updates: - package-ecosystem: "nuget" directory: "/" @@ -23,3 +34,27 @@ updates: - "major" patterns: - "*" + + - package-ecosystem: "dotnet-sdk" + directory: "/" + patterns: + - "*" + multi-ecosystem-group: "infrastructure" + cooldown: + default-days: 7 + + - package-ecosystem: "github-actions" + directory: "/" + patterns: + - "*" + multi-ecosystem-group: "infrastructure" + cooldown: + default-days: 7 + + - package-ecosystem: "uv" + directory: "/docsite" + patterns: + - "*" + multi-ecosystem-group: "infrastructure" + cooldown: + default-days: 7 diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..c2860dd --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,34 @@ +name: Dependabot auto-merge + +on: + pull_request_target: + types: [opened, synchronize, reopened] + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'LayeredCraft/sharp-mud' + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Approve PR + if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable auto-merge for Dependabot PRs + if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}