File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -138,16 +138,20 @@ jobs:
138138 npx semantic-release
139139 fi
140140
141+ # npm publish uses OIDC (id-token: write + --provenance). No NPM_TOKEN needed.
142+ # Require on npmjs.com: Package → Package settings → Trusted publishers →
143+ # Add: GitHub Actions, org cloudinary-devs, repo create-cloudinary-react, workflow release.yml
144+ # Unset token env vars so npm uses OIDC only; stale NPM_TOKEN/NODE_AUTH_TOKEN causes "Access token expired".
141145 - name : Publish to npm using trusted publishing
142146 if : github.event.inputs.dry_run != 'true'
147+ env :
148+ NODE_AUTH_TOKEN : ' '
149+ NPM_TOKEN : ' '
143150 run : |
144151 echo "=== Publishing to npm with trusted publishing (OIDC) ==="
145-
146- # Ensure .npmrc is available (setup-node should have created it)
147- if [ -f "$NPM_CONFIG_USERCONFIG" ]; then
148- cp "$NPM_CONFIG_USERCONFIG" ~/.npmrc
149- echo "✓ Using .npmrc for authentication"
150- fi
152+ unset NODE_AUTH_TOKEN NPM_TOKEN 2>/dev/null || true
153+ # Use minimal .npmrc so npm uses OIDC, not a stale token from setup-node
154+ echo "registry=https://registry.npmjs.org/" > ~/.npmrc
151155
152156 # Get versions
153157 VERSION_BEFORE="${{ steps.version-before.outputs.version }}"
You can’t perform that action at this time.
0 commit comments