Skip to content

Commit 867b55c

Browse files
yanxue06claude
andauthored
ci(publish-npm): upgrade npm so OIDC Trusted Publishing works (#80)
npm OIDC Trusted Publishing requires npm >= 11.5.1, but the publish job runs on Node 20 which bundles npm 10.x. On npm 10 the OIDC publish step signs provenance but cannot authenticate tokenlessly, so it falls through to an unauthenticated publish and fails with E404 ("not in this registry"). Install npm@latest after setup-node, before the publish steps, so the OIDC path can actually authenticate. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6a806c0 commit 867b55c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/blocks/publish-npm/action.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ runs:
4646
node-version: ${{ inputs.node-version }}
4747
registry-url: 'https://registry.npmjs.org'
4848

49+
# npm OIDC Trusted Publishing requires npm >= 11.5.1, but Node 20 ships
50+
# npm 10.x. Without this, the OIDC publish below signs provenance yet can't
51+
# authenticate tokenlessly, so it publishes unauthenticated and 404s.
52+
- name: Upgrade npm for OIDC Trusted Publishing
53+
shell: bash
54+
run: |
55+
npm install -g npm@latest
56+
echo "npm version: $(npm --version)"
57+
4958
- name: Install dependencies
5059
shell: bash
5160
working-directory: ${{ inputs.working-directory }}

0 commit comments

Comments
 (0)