diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..64b3c47 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,38 @@ +# managed-by: seven-io/isms-tools/scripts/dependabot-rollout.sh +# Dependabot config: scheduled + grouped security updates. Do not edit by hand; +# changes should be made in the script and re-rolled out with FORCE_UPDATE=true. +# See: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + open-pull-requests-limit: 5 + cooldown: + default-days: 5 + semver-major-days: 14 + semver-minor-days: 7 + semver-patch-days: 3 + groups: + security-all: + applies-to: security-updates + patterns: ["*"] + minor-patch: + applies-to: version-updates + patterns: ["*"] + update-types: ["minor", "patch"] + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + open-pull-requests-limit: 2 + cooldown: + default-days: 5 + semver-major-days: 14 + semver-minor-days: 7 + semver-patch-days: 3 + groups: + actions-all: + patterns: ["*"] \ No newline at end of file diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..ff8ea15 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,26 @@ +name: Dependabot auto-merge +# pull_request_target is required so that Dependabot-triggered runs get a token +# with write permissions. Safe here because we never check out PR code — we only +# call the gh CLI on the PR metadata. +on: pull_request_target + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Fetch metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + - name: Enable auto-merge for patch-only updates (version + security) + if: >- + steps.metadata.outputs.update-type == 'version-update:semver-patch' || + steps.metadata.outputs.update-type == 'security-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 }} \ No newline at end of file