From f8a3a66845d8801e57e918435945f8fcb6884b33 Mon Sep 17 00:00:00 2001 From: nicodes Date: Mon, 3 Aug 2026 15:36:45 -0600 Subject: [PATCH] Automate safe Dependabot updates --- .github/dependabot.yml | 15 +++++++-------- .github/workflows/dependabot.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 89a723c..b154457 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,13 +6,9 @@ # has gone stale -- a tag at least reads as a version. This is the thing that # tells you. # -# Grouped into one pull request rather than one per action. These are all the -# same kind of change, and a pin bump arriving alone every few days is how pin -# bumps stop being read at all. -# -# Scoped to github-actions. The aviorstudio/* and nicodes/* refs stay on version -# tags by decision, and dependabot will offer those as version bumps rather than -# opaque SHA changes. +# Minor and patch updates are grouped: they share the same risk profile and CI +# can merge them without ceremony. Major updates are deliberately excluded, so +# Dependabot opens one reviewable pull request for each breaking-change boundary. version: 2 updates: - package-ecosystem: github-actions @@ -20,6 +16,9 @@ updates: schedule: interval: weekly groups: - actions: + actions-minor-patch: patterns: - "*" + update-types: + - minor + - patch diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000..157be10 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,31 @@ +name: Dependabot + +# Dependabot's minor and patch action updates are grouped in dependabot.yml. +# Once the required CI check passes, this marks only those low-risk updates for +# squash merge. Major updates never satisfy the condition and remain manual. +on: + pull_request: + +permissions: + contents: write + pull-requests: write + +jobs: + auto-merge: + if: github.event.pull_request.user.login == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - name: Read Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable auto-merge for minor and patch updates + if: >- + steps.metadata.outputs.update-type == 'version-update:semver-minor' || + steps.metadata.outputs.update-type == 'version-update:semver-patch' + run: gh pr merge --auto --squash "$PR_URL" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }}