Skip to content

Commit 206413b

Browse files
committed
fix(ci): dependabot auto-merge — block grouped major bumps
Old check evaluated steps.meta.outputs.update-type which only reflects the first dependency in a grouped PR. A grouped PR with one minor dep + several major-bump deps would auto-merge unattended. Incident 2026-05-04: Operational-Dashboard PR #7 (grouped runtime-deps) included astro 5→6, tailwind 3→4, TS 5→6. Auto-merged. CF Workers Build rejected the resulting peer-dep tree, dashboard.umbrellaitgroup.com went down. New check additionally requires steps.meta.outputs.dependency-major-versions-changed == '' which is non-empty when ANY dep in the group has a major bump. Major-bump PRs get labeled 'needs-review,major-version' so they don't sit silently. Bumps fetch-metadata to v3 if not already.
1 parent df1d24c commit 206413b

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/dependabot-auto-merge.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,31 @@ jobs:
1717
with:
1818
github-token: ${{ secrets.GITHUB_TOKEN }}
1919

20-
- name: Enable auto-merge for patch + minor bumps
21-
if: steps.meta.outputs.update-type == 'version-update:semver-patch' || steps.meta.outputs.update-type == 'version-update:semver-minor'
20+
# Block auto-merge when ANY dep in the PR is a major bump.
21+
# `dependency-major-versions-changed` is non-empty when ANY dep in
22+
# a grouped PR has a major bump, even if `update-type` (which only
23+
# reflects the first dep in the group) says "minor".
24+
#
25+
# Incident reference (2026-05-04): grouped runtime-deps PR in
26+
# Operational-Dashboard included astro 5→6, tailwind 3→4, TS 5→6.
27+
# Old check evaluated `semver-minor` true on the first entry and
28+
# merged the whole batch. CF Workers Build then rejected the tree.
29+
- name: Enable auto-merge for non-major bumps only
30+
if: |
31+
(steps.meta.outputs.update-type == 'version-update:semver-patch'
32+
|| steps.meta.outputs.update-type == 'version-update:semver-minor')
33+
&& steps.meta.outputs.dependency-major-versions-changed == ''
2234
run: gh pr merge --squash --auto "$PR_URL"
2335
env:
2436
PR_URL: ${{ github.event.pull_request.html_url }}
2537
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
# Major bumps need hand review. Label so they don't sit silently.
40+
# `|| true` because the label may not exist in the repo yet — that
41+
# shouldn't fail the workflow, the auto-merge skip already protects.
42+
- name: Label major-version PRs for hand review
43+
if: steps.meta.outputs.dependency-major-versions-changed != ''
44+
run: gh pr edit "$PR_URL" --add-label "needs-review,major-version" || true
45+
env:
46+
PR_URL: ${{ github.event.pull_request.html_url }}
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)