From 1d98eb146562ece6a74df5186c243dd2ca9715f7 Mon Sep 17 00:00:00 2001 From: Nick Cipollina Date: Wed, 22 Jul 2026 13:21:22 -0400 Subject: [PATCH] ci(github): configure dependabot automation --- .github/dependabot.yml | 36 +++++++++++++++++-- .github/workflows/dependabot-auto-merge.yml | 34 ++++++++++++++++++ ...redCraft.Logging.CompactJsonFormatter.slnx | 1 + 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/dependabot-auto-merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8416c23..f1ba046 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: "/" @@ -6,7 +17,28 @@ updates: interval: "weekly" day: "wednesday" open-pull-requests-limit: 25 + cooldown: + default-days: 7 + commit-message: + prefix: "chore" + include: "scope" groups: - dotnet: + dotnet-minor-patch: + update-types: + - "minor" + - "patch" + patterns: + - "*" + dotnet-major: + update-types: + - "major" patterns: - - "*" \ No newline at end of file + - "*" + + - package-ecosystem: "github-actions" + directory: "/" + 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..df03a4d --- /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/compact-json-formatter' + 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 }} diff --git a/LayeredCraft.Logging.CompactJsonFormatter.slnx b/LayeredCraft.Logging.CompactJsonFormatter.slnx index da9c714..3b5d03e 100644 --- a/LayeredCraft.Logging.CompactJsonFormatter.slnx +++ b/LayeredCraft.Logging.CompactJsonFormatter.slnx @@ -1,6 +1,7 @@ +