ci: switch npm publish to trusted publishing (OIDC)#695
Merged
Conversation
The @launchdarkly/ldcli npm package now has trusted publishing
configured on the npm side, which rejects legacy NODE_AUTH_TOKEN
publishes (npm returns 404 to obscure auth failures). Align the
release-please and manual-publish workflows with the OIDC pattern
already used by js-client-sdk, observability-sdk, and launchdarkly-
toolbar:
* bump actions/setup-node v3 -> v4
* install npm 11.6.2 (trusted publishing requires >= 11.5.1)
* drop the SSM-sourced NODE_AUTH_TOKEN; npm CLI picks up the OIDC
token automatically via the existing id-token: write permission
No changes to scripts/publish-npm.sh (already uses --provenance
--access public, same as the sibling repos).
Made-with: Cursor
Vadman97
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm publish404 that broke thev3.0.3release after trusted publishing was enabled on@launchdarkly/ldcli: bumpsactions/setup-nodetov4, installsnpm@11.6.2(OIDC support requires>= 11.5.1), and drops theNODE_AUTH_TOKENSSM lookup so the npm CLI uses the OIDC token fromid-token: write.js-client-sdk,observability-sdk(@launchdarkly/*packages), andlaunchdarkly-toolbar—ldcliwas the last repo still on the legacy static-token path.release-please.yml(auto release path) andmanual-publish.yml(workflow_dispatchrecovery path). No changes toscripts/publish-npm.sh.npm-side config
For both workflows to publish successfully, the npm trusted publisher config on
@launchdarkly/ldclimust list this repo + workflow filenames:release-please.yml(already configured)manual-publish.yml(needs to be added if we want the manual recovery path to work end-to-end)Test plan
manual-publish.ymlforv3.0.3and confirm npm publish succeeds without a token.v3.0.3GitHub release once the npm package + attestations are in place.release-pleasecut, confirm the auto path publishes cleanly end-to-end.Made with Cursor
Note
Medium Risk
Touches release automation for npm publishing; misconfiguration of npm trusted publisher/workflow name or npm version could block releases even though the change is confined to CI.
Overview
Updates the
release-ldcli-npmjobs in bothrelease-please.ymlandmanual-publish.ymlto publish to npm via trusted publishing (OIDC) instead of retrieving and usingNODE_AUTH_TOKENfrom SSM.Bumps
actions/setup-nodefromv3tov4and installsnpm@11.6.2in the workflow to ensure the npm CLI supports OIDC-based publishing.Reviewed by Cursor Bugbot for commit 4b94ac9. Bugbot is set up for automated code reviews on this repo. Configure here.