diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..ddf7c89 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,25 @@ +# Turns on squash auto-merge for Dependabot's minor and patch bumps of +# the actions org-ci.yml uses. The ruleset still gates the merge on +# "ci / flake-check". Major bumps wait for the owner: every org repo +# calls org-ci.yml@main, so a merged bump reaches all of them at once. +name: dependabot-auto-merge + +on: pull_request + +permissions: {} + +jobs: + auto-merge: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: dependabot/fetch-metadata@v3 + id: meta + - if: steps.meta.outputs.update-type != 'version-update:semver-major' + run: gh pr merge --auto --squash "$PR" + env: + PR: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/documentation/docs/ci.md b/documentation/docs/ci.md index f8cc8dc..e2fb878 100644 --- a/documentation/docs/ci.md +++ b/documentation/docs/ci.md @@ -36,6 +36,10 @@ Callers pin `@main`: one maintainer, and every change to `org-ci.yml` lands through a PR whose own CI ran it. Dependabot (`.github/dependabot.yml`) keeps the actions it uses current, once, for every repo. +`dependabot-auto-merge.yml` turns on squash auto-merge for its minor and +patch bumps; they merge once `ci / flake-check` passes. Major bumps wait +for the owner. + ## Versioning The `release` job tags `..`: