Skip to content

Commit 8282a37

Browse files
committed
Restore npm upgrade for OIDC trusted publishing
Trusted publishing requires npm 11.5.1+ (the registry rejects the unauthenticated PUT from older clients with a misleading 404). #73 had replaced the upgrade with a `--provenance` capability check that passes on npm 10.x, breaking v0.2.0 and v0.2.1 publishes. Mirror basecamp-sdk's working setup: install npm@latest, then assert the floor so a future @latest regression fails clearly instead of as another registry E404.
1 parent 1b9aec2 commit 8282a37

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/release-typescript.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,17 @@ jobs:
8282
cache: 'npm'
8383
cache-dependency-path: typescript/package-lock.json
8484

85-
- name: Verify npm provenance support
85+
- name: Upgrade npm for OIDC trusted publishing
86+
run: npm install -g npm@latest
87+
88+
- name: Verify npm version supports trusted publishing
8689
run: |
87-
echo "npm version: $(npm --version)"
88-
npm publish --help | grep -q -- '--provenance' || \
89-
{ echo "::error::npm does not support publish --provenance"; exit 1; }
90+
INSTALLED=$(npm --version)
91+
echo "npm version: $INSTALLED"
92+
node -e 'const [M,m,p]=process.argv[1].split(".").map(Number); process.exit(M > 11 || (M === 11 && (m > 5 || (m === 5 && p >= 1))) ? 0 : 1)' "$INSTALLED" || {
93+
echo "::error::npm $INSTALLED is too old for trusted publishing (need 11.5.1+)"
94+
exit 1
95+
}
9096
9197
- name: Install dependencies
9298
run: npm ci

0 commit comments

Comments
 (0)