File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -141,17 +141,18 @@ jobs:
141141 # npm publish uses OIDC (id-token: write + --provenance). No NPM_TOKEN needed.
142142 # Require on npmjs.com: Package → Package settings → Trusted publishers →
143143 # 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" .
144+ # Force OIDC-only: override NPM_CONFIG_USERCONFIG so npm ignores setup-node's .npmrc (which may reference a stale token) .
145145 - name : Publish to npm using trusted publishing
146146 if : github.event.inputs.dry_run != 'true'
147147 env :
148148 NODE_AUTH_TOKEN : ' '
149149 NPM_TOKEN : ' '
150+ NPM_CONFIG_USERCONFIG : ' ${{ runner.temp }}/.npmrc-oidc'
150151 run : |
151152 echo "=== Publishing to npm with trusted publishing (OIDC) ==="
152153 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
154+ # Config that has only registry — no _authToken — so npm uses OIDC
155+ echo "registry=https://registry.npmjs.org/" > "$NPM_CONFIG_USERCONFIG"
155156
156157 # Get versions
157158 VERSION_BEFORE="${{ steps.version-before.outputs.version }}"
You can’t perform that action at this time.
0 commit comments