diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b730d53 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 + +updates: + - package-ecosystem: npm + directory: / + rebase-strategy: auto + schedule: + interval: "weekly" + commit-message: + prefix: "chore(deps):" + versioning-strategy: increase + # Patch bumps grouped into one PR (auto-merged on green CI); minor bumps + # grouped into a separate PR for manual review; majors open individually. + groups: + patch: + patterns: + - "*" + update-types: + - patch + minor: + patterns: + - "*" + update-types: + - minor diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..35d5a26 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,25 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + auto-merge: + if: ${{ github.actor == 'dependabot[bot]' }} + runs-on: ubuntu-latest + + steps: + - name: Fetch update metadata + id: meta + uses: dependabot/fetch-metadata@v2 + + # Auto-merge patch updates once the required checks pass. Minor and major + # updates are left for manual review (the `if` below excludes them). + - name: Enable auto-merge for patch + if: ${{ steps.meta.outputs.update-type == 'version-update:semver-patch' }} + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}