Repository navigation
CHANGE @W-24708955@ Migrate npm publishing to Trusted Publishing (OIDC) - #514
nikhil-mittal-165 wants to merge 4 commits into
Conversation
Replace the long-lived NPM_TOKEN with npm Trusted Publishing, ahead of npm's bypass-2fa publish deprecation. - Grant id-token: write on the publish job - Move the publish job to Node 22 and upgrade npm (Trusted Publishing needs Node >= 22.14.0 and npm >= 11.5.1; OIDC dist-tag needs npm >= 11.21.0) - Drop the NPM_TOKEN .npmrc write Requires each published package to have this workflow configured as a trusted publisher on npmjs.com (with "Allow npm dist-tag" enabled) before merging. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Git2Gus App is installed but the |
Install npm@11 (>= 11.21.0 has OIDC dist-tag support) instead of latest, to stay consistent with the code-analyzer repo, which must stay on npm 11 because npm 12 removed shrinkwrap support. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Self-review using the refreshed Code Analyzer regression-review skill. FindingsNo production-code defect found in the workflow diff. The Node/npm minimums, job-level Manual validation before mergeRequired:
Recommended:
Evidence checked: complete workflow diff, downstream post-release job dependency, and current official npm/GitHub OIDC requirements. No live publish was performed by this review. |
The workflow installs the moving npm@11 tag. Print the resolved version and fail fast if it is older than 11.21.0 (needed for dist-tag management via OIDC) instead of failing mid-release. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Added the recommended npm version guard in e697718: the workflow now prints the resolved npm version and fails fast if it is below 11.21.0. The manual validation items (trusted publisher config, dry run, first real publish) are still outstanding. 🤖 Generated with Claude Code |
Each published package must first have a trusted publisher configured on npmjs.com (see Merge order). The title has a placeholder GUS id (
W-00000000) that must be replaced before the PR title check passes.Why
npm is ending publishes with bypass-2fa tokens in Jan 2027, so
NPM_TOKENpublishing must move to Trusted Publishing (OIDC). The Platform CLI announcement names onlyforcedotcom/code-analyzer(token expires Nov 12, 2026); whether core's token is covered is unconfirmed. Core publishes 11 packages to npm via this workflow, so it needs the same migration.What changed (
publish-package-to-npm.yml,build-and-test-and-publishjob)id-token: write/contents: read.npm@11(>= 11.5.1 to publish, >= 11.21.0 for OIDC dist-tag). Pinned to 11 for consistency with forcedotcom/code-analyzer, which must stay on npm 11 (npm 12 dropped shrinkwrap support)..npmrcNPM_TOKENwrite.npm publishandnpm dist-tag addnow authenticate via OIDC.Merge order
publish-package-to-npm.yml, with "Allow npm dist-tag" enabled:code-analyzer-core, engine-api, eslint-engine, eslint8-engine, flow-engine, pmd-engine, regex-engine, retirejs-engine, sfge-engine, apexguru-engine, uibundle-engine (all
@salesforce/...).Open questions
enginesallows >=20). Not yet run in CI.--dry-rundoes not prove OIDC works; only a real publish does.🤖 Generated with Claude Code