Skip to content

Commit d51132b

Browse files
committed
test(pm): pin a changed permissions key and a github.token reference in the split battery
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jU8C3iu8fsXdU4Rm8o
1 parent 268167f commit d51132b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎scripts/pm/check-governed-merges.mjs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
10751075
'⭐ the argv is CLOSED: a flag the mode does not read, or a second repository beside a bare --pr, is refused': 22,
10761076
'the per-row repository scope (ruled B2, 2026-10-13)': 20,
10771077
'the nested `ui/` workspace rows, on the register (#25712)': 16,
1078-
'⭐ the workflows split: Tier H by path or by C2 trigger, else Tier S (ruling record 6722205630)': 43,
1078+
'⭐ the workflows split: Tier H by path or by C2 trigger, else Tier S (ruling record 6722205630)': 45,
10791079
});
10801080

10811081
// DELETING an entry silences that battery's floor exactly as effectively as
@@ -5193,6 +5193,11 @@ async function selfTest() {
51935193

51945194
// Tier H by DIFF: one pin per C2 trigger.
51955195
assert('C2-permissions-added-is-H', isH(tierOf(edit(' timeout-minutes: 20', ' timeout-minutes: 20\n permissions:\n contents: write')), /`permissions:` block/), show(tierOf(edit(' timeout-minutes: 20', ' timeout-minutes: 20\n permissions:\n contents: write'))));
5196+
const READ_PERMS = edit('jobs:\n', 'permissions:\n contents: read\njobs:\n');
5197+
const widened = tierOf(READ_PERMS.replace('contents: read', 'contents: write'), { base: READ_PERMS });
5198+
assert('C2-a-changed-permissions-key-is-H', isH(widened, /`permissions:` block/), show(widened));
5199+
const tokened = tierOf(edit(' - run: pnpm vitest run', ' - run: pnpm vitest run\n env:\n GH_TOKEN: ${{ github.token }}'));
5200+
assert('C2-a-github-token-reference-added-is-H', isH(tokened, /secrets\.\*|github\.token/), show(tokened));
51965201
assert('C2-a-secrets-reference-added-is-H', isH(tierOf(edit(' - run: pnpm vitest run', ' - run: pnpm vitest run\n env:\n NPM_TOKEN: ${{ secrets.NPM_TOKEN }}')), /secrets\.\*/));
51975202
assert('C2-pull_request_target-is-H', isH(tierOf(edit(' merge_group:', ' merge_group:\n pull_request_target:')), /pull_request_target/));
51985203
assert('C2-a-uses-no-workflow-on-the-base-uses-is-H', isH(tierOf(edit(' - uses: actions/checkout@v7', ' - uses: actions/checkout@v7\n - uses: someone/new-action@v1')), /not used anywhere on the base tree: `someone\/new-action`/));

0 commit comments

Comments
 (0)