Skip to content

Commit 90423e5

Browse files
ihor-sokoliukclaude
andcommitted
docs(ci): mark npm trusted-publishing upgrade step as do-not-remove
Add a prominent DO-NOT-REMOVE rationale and a fail-fast guard message so the pinned `npm install -g npm@11.17.0` step is not stripped again. It is required for OIDC trusted publishing (npm >= 11.5.1) on the Node 20 runner; its removal (SEC-015) broke the v1.6.0 publish with E404. Pinned to an exact version, so the "mutable npm" supply-chain warning does not apply to this step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4a90a1c commit 90423e5

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,21 @@ jobs:
2323
node-version: '20'
2424
registry-url: 'https://registry.npmjs.org/'
2525

26-
- name: Pin npm for OIDC trusted publishing
27-
# Tokenless OIDC trusted publishing needs npm >= 11.5.1; Node 20 ships npm ~10.
28-
# Pinned to a specific version (not @latest) to avoid a mutable supply-chain step.
26+
# ──────────────────────────────────────────────────────────────────────
27+
# ⚠️ DO NOT REMOVE / DO NOT "SIMPLIFY" THIS STEP. It is load-bearing.
28+
#
29+
# Tokenless OIDC "trusted publishing" (used below — `npm publish --provenance`
30+
# with NO NODE_AUTH_TOKEN) requires npm >= 11.5.1, but the GitHub-hosted
31+
# Node 20 runner ships npm ~10. Without this upgrade the publish fails with:
32+
# npm error 404 'mcp-searxng@<version>' is not in this registry
33+
# This exact regression shipped in v1.6.0 — see SEC-015 in TODO-done.md.
34+
#
35+
# It is pinned to an EXACT version (NOT `@latest`), so the "mutable npm
36+
# command" / supply-chain finding that previously prompted its removal does
37+
# NOT apply here. Ignore that warning for this step and leave it in place.
38+
# To update it, change ONLY the pinned version — and it must stay >= 11.5.1.
39+
# ──────────────────────────────────────────────────────────────────────
40+
- name: Pin npm for OIDC trusted publishing (REQUIRED — do not remove)
2941
run: npm install -g npm@11.17.0
3042

3143
- name: Verify npm provenance support
@@ -39,7 +51,8 @@ jobs:
3951
}
4052
const [major, minor] = version;
4153
if (major < 11 || (major === 11 && minor < 5)) {
42-
throw new Error('npm >= 11.5.1 is required for OIDC trusted publishing');
54+
// If this throws, the pinned npm upgrade step above was removed or downgraded.
55+
throw new Error('npm >= 11.5.1 is required for OIDC trusted publishing. Restore the pinned (npm install -g npm@11.17.0) step above — do not remove it. See SEC-015 in TODO-done.md.');
4356
}
4457
"
4558

0 commit comments

Comments
 (0)