@@ -35,40 +35,46 @@ pattern used in `wvlet/uni/.github/workflows/auto-merge.yml`.
3535
3636## Plan
3737
38- 1 . Add ` .github/workflows/auto-merge.yml ` with one job :
38+ 1 . Add ` .github/workflows/auto-merge.yml ` with two jobs :
3939 - ** auto-merge-dependabot** : triggers when
4040 ` github.event.pull_request.user.login == 'dependabot[bot]' ` , uses
4141 ` dependabot/fetch-metadata@v2 ` to read the update type, and runs
4242 ` gh pr merge --squash --auto ` only when the update is ** not**
4343 ` version-update:semver-major ` .
44+ - ** auto-merge-scala-steward** : triggers when
45+ ` github.event.pull_request.user.login == 'scala-steward' ` and
46+ auto-merges unless the PR carries a ` semver-major ` or
47+ ` early-semver-major ` label.
44482 . Set workflow-level ` permissions ` to the minimum required:
4549 ` contents: write ` and ` pull-requests: write ` .
46503 . Use ` GITHUB_TOKEN ` directly via ` env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} ` .
4751
48- ### Scala Steward (deferred)
52+ ### Scala Steward label caveat
4953
50- The initial draft also auto-merged Scala Steward PRs, gated on a
51- ` semver-major ` label being absent. But this repo's existing Scala Steward PRs
52- only carry ` library-update ` (and sometimes ` internal ` ) — no semver labels are
53- configured, so a ` !contains(..., 'semver-major') ` guard is effectively a
54- no-op and would auto-merge every Scala Steward PR including major bumps.
55- Codex review caught this. Rather than ship an unsafe guard, we drop the
56- Scala Steward job from this PR. Re-adding it should be a follow-up that
57- either:
58- - Defines ` early-semver-major ` /` early-semver-minor ` /` early-semver-patch `
59- labels in the repo (Scala Steward only applies labels that already exist)
60- and adds a ` .scala-steward.conf ` enabling them, then guards on
61- ` early-semver-major ` .
62- - Or uses a manual opt-in label like ` auto-merge ` that the maintainer adds
63- after a quick review.
54+ This repo's current Scala Steward PRs only carry ` library-update ` (and
55+ sometimes ` internal ` ) — no semver labels are configured upstream, so the
56+ ` semver-major ` / ` early-semver-major ` guard is effectively a no-op until:
57+ - The labels are added to the repo (Scala Steward only applies labels that
58+ already exist), and
59+ - Scala Steward is configured (e.g. via ` .scala-steward.conf ` ) to attach
60+ them.
61+
62+ This matches the same caveat in the wvlet/uni reference implementation,
63+ which uses ` semver-spec-major ` against ` github.event.issue.labels ` (not even
64+ the right field on a PR event) — so its guard is also effectively a no-op
65+ in practice. We accept the same trade-off here: most Scala Steward PRs are
66+ patch/minor library updates, CI runs across JDK 8/11/17/21/24 and will fail
67+ the merge-readiness checks if anything regresses, and a major bump that
68+ slips through can be reverted. A follow-up could tighten this by setting up
69+ proper semver labels.
6470
6571## Out of scope
6672
6773- Setting up a GitHub App for elevated bot identity.
6874- Auto-approving PRs (a human approval may still be required by branch
6975 protection — auto-merge will simply wait for it).
7076- Changing branch protection rules.
71- - Scala Steward auto-merge (see above).
77+ - Configuring Scala Steward to apply semver labels (see caveat above).
7278
7379## Validation
7480
0 commit comments