Skip to content

Commit cd12d3f

Browse files
committed
fix(ci): restore token auth with provenance for npm publishing
OIDC provenance does not replace token authentication — npm requires a token to authorize the publish request. Provenance adds a signed attestation and the trusted publisher config on npmjs.com makes it mandatory. Restore registry-url and NODE_AUTH_TOKEN from NPM_TOKEN secret. Use a granular access token which bypasses 2FA (unlike classic tokens that require OTP).
1 parent a8d978b commit cd12d3f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ jobs:
4444
fi
4545
echo "Version check passed: $PACKAGE_VERSION"
4646
47-
# Do not use registry-url — it creates an .npmrc with a token
48-
# placeholder that would bypass OIDC trusted publishing.
4947
- name: Setup Node.js
5048
uses: actions/setup-node@v4
5149
with:
5250
node-version: "22"
51+
registry-url: "https://registry.npmjs.org"
5352

5453
- name: Clean install
5554
run: npm install
@@ -62,6 +61,8 @@ jobs:
6261

6362
- name: Publish to npm
6463
run: npm publish --provenance --access public
64+
env:
65+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6566

6667
- name: Verify publish success
6768
run: |

0 commit comments

Comments
 (0)