Skip to content

Commit 0a9cf4c

Browse files
committed
ci(release): publish to npm via trusted publishing (OIDC)
The publish job failed with npm E404 because it published unauthenticated (no NODE_AUTH_TOKEN; setup-node's placeholder token). Switch to npm Trusted Publishing instead of a long-lived token: - upgrade npm to >= 11.5.1 (OIDC support) after setup-node - drop NODE_AUTH_TOKEN and the --provenance flag; with the GitHub Actions OIDC environment (id-token: write) npm authenticates via the per-package Trusted Publisher on npmjs.com and generates provenance automatically Requires a Trusted Publisher configured on npmjs.com for each @pleaseai/code* package (repo pleaseai/code-intelligence, workflow file release-please.yml).
1 parent 559a54d commit 0a9cf4c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,16 @@ jobs:
7979
- name: Build npm packages
8080
run: bun run build:npm
8181

82+
# Trusted publishing (OIDC) needs npm >= 11.5.1; setup-node's bundled npm may be older.
83+
- name: Upgrade npm for trusted publishing
84+
run: npm install -g npm@latest
85+
86+
# No NODE_AUTH_TOKEN: npm detects the GitHub Actions OIDC environment (id-token: write)
87+
# and authenticates via the per-package Trusted Publisher configured on npmjs.com.
88+
# Provenance is generated automatically for trusted publishing.
8289
- name: Publish to npm
8390
run: |
8491
for dir in npm/code-*; do
85-
(cd "$dir" && npm publish --provenance --access public)
92+
(cd "$dir" && npm publish --access public)
8693
done
87-
cd npm/code && npm publish --provenance --access public
94+
cd npm/code && npm publish --access public

0 commit comments

Comments
 (0)