Skip to content

ci: switch npm publish to trusted publishing (OIDC)#695

Merged
nieblara merged 1 commit intomainfrom
rniebla/npm-trusted-publishing
Apr 17, 2026
Merged

ci: switch npm publish to trusted publishing (OIDC)#695
nieblara merged 1 commit intomainfrom
rniebla/npm-trusted-publishing

Conversation

@nieblara
Copy link
Copy Markdown
Contributor

@nieblara nieblara commented Apr 17, 2026

Summary

  • Fixes the npm publish 404 that broke the v3.0.3 release after trusted publishing was enabled on @launchdarkly/ldcli: bumps actions/setup-node to v4, installs npm@11.6.2 (OIDC support requires >= 11.5.1), and drops the NODE_AUTH_TOKEN SSM lookup so the npm CLI uses the OIDC token from id-token: write.
  • Matches the pattern already in use by js-client-sdk, observability-sdk (@launchdarkly/* packages), and launchdarkly-toolbarldcli was the last repo still on the legacy static-token path.
  • Applied identically to both release-please.yml (auto release path) and manual-publish.yml (workflow_dispatch recovery path). No changes to scripts/publish-npm.sh.

npm-side config

For both workflows to publish successfully, the npm trusted publisher config on @launchdarkly/ldcli must 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

  • Merge; re-run manual-publish.yml for v3.0.3 and confirm npm publish succeeds without a token.
  • Un-draft the v3.0.3 GitHub release once the npm package + attestations are in place.
  • On the next release-please cut, 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-npm jobs in both release-please.yml and manual-publish.yml to publish to npm via trusted publishing (OIDC) instead of retrieving and using NODE_AUTH_TOKEN from SSM.

Bumps actions/setup-node from v3 to v4 and installs npm@11.6.2 in 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.

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
@nieblara nieblara merged commit 093dae4 into main Apr 17, 2026
13 checks passed
@nieblara nieblara deleted the rniebla/npm-trusted-publishing branch April 17, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants