Skip to content

Commit f972c2d

Browse files
amir0ffcursoragent
andcommitted
fix(ci): publish with npm trusted publishing (OIDC only)
Remove NPM_TOKEN auth in favor of OIDC. Requires trusted publisher on npm and Node 24 with npm 11+. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 410da85 commit f972c2d

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

.github/workflows/ubuntu_node.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
uses: actions/setup-node@v4
3131
with:
3232
node-version: 24
33+
registry-url: 'https://registry.npmjs.org'
3334

3435
- name: 🗑️ Get pnpm store directory
3536
shell: bash
@@ -53,23 +54,14 @@ jobs:
5354
- name: 🏗️ Build main package
5455
run: pnpm run build
5556

57+
# Publishes via npm Trusted Publishing (OIDC). Requires trusted publisher
58+
# configured on npmjs.com for workflow "ubuntu_node.yml". Do NOT set NPM_TOKEN.
5659
- name: 🚚 Publish to NPM
5760
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
5861
working-directory: packages/main
59-
env:
60-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6162
run: |
6263
npm install -g npm@latest
63-
if [ -z "$NODE_AUTH_TOKEN" ]; then
64-
echo "::error::NPM_TOKEN secret is missing. Create an Automation token at https://www.npmjs.com/settings/amiroff157/tokens and add it as the NPM_TOKEN repository secret."
65-
exit 1
66-
fi
67-
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
68-
npm whoami || {
69-
echo "::error::NPM_TOKEN is invalid or expired. Regenerate an Automation token at https://www.npmjs.com/settings/amiroff157/tokens and update the NPM_TOKEN secret."
70-
exit 1
71-
}
72-
npm publish --provenance --access public
64+
npm publish --access public
7365
7466
- name: 🏗️ Build example app
7567
run: pnpm run build:example

0 commit comments

Comments
 (0)