Skip to content

ci(release): Publish npm packages with OIDC trusted publishing - #5276

Closed
thomas-lebeau wants to merge 1 commit into
mainfrom
thomas.lebeau/npm-oidc
Closed

thomas-lebeau wants to merge 1 commit into
mainfrom
thomas.lebeau/npm-oidc

Conversation

@thomas-lebeau

@thomas-lebeau thomas-lebeau commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

The npm publish currently relies on a long-lived npm token stored in Vault, which has to be renewed regularly. npm trusted publishing (OIDC) removes the secret and adds provenance, but only works from a supported CI provider such as GitHub Actions, not GitLab.

Closes RUM-19961

Changes

  • Add a publish-npm.yml GitHub workflow that publishes with OIDC and provenance, in the npm-publish environment, only on a vX.Y.Z tag matching the package.json version.
  • GitLab step-6_publish-npm keeps the cordon check, then runs dispatch-publish-npm.ts: it dispatches the workflow on the release tag with a tag-only dd-octo-sts token (new self.gitlab.publish.sts.yaml policy) and waits for the run. Retrying is safe thanks to --tolerate-republish.
  • publish-npm.ts no longer reads the token from Vault (getNpmToken removed). NPM_TOKEN is an optional escape hatch, for example for the first publish of a new package. It also refuses to publish non-X.Y.Z versions, since packages are always tagged latest.

Test instructions

  • Unit tests: yarn test:script (new dispatch-publish-npm.spec.ts, updated publish-npm.spec.ts).
  • Prerequisites outside this PR: configure the trusted publisher (DataDog/browser-sdk, publish-npm.yml, environment npm-publish) on each package on npmjs.com, and create the npm-publish environment restricted to v* tags.
  • Dry run: dispatch the workflow on a release tag with dry-run enabled.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

Refs: RUM-19961

…GitHub Actions

Move the npm publish to a publish-npm.yml GitHub workflow that authenticates
to npm with OIDC (with provenance). GitLab step-6 keeps the cordon check, then
dispatches the workflow on the release tag with a tag-only dd-octo-sts token
and waits for the run.
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum Salesforce 192.54 KiB 192.54 KiB 0 B 0.00% ✅
Rum 192.52 KiB 192.52 KiB 0 B 0.00% ✅
Rum Profiler 8.17 KiB 8.17 KiB 0 B 0.00% ✅
Rum Salesforce Profiler 8.17 KiB 8.17 KiB 0 B 0.00% ✅
Rum Salesforce Recorder 32.62 KiB 32.62 KiB 0 B 0.00% ✅
Rum Recorder 32.62 KiB 32.62 KiB 0 B 0.00% ✅
Logs 60.26 KiB 60.26 KiB 0 B 0.00% ✅
Rum Slim 148.45 KiB 148.45 KiB 0 B 0.00% ✅
Worker 24.23 KiB 24.23 KiB 0 B 0.00% ✅
Rum Shopify 223.58 KiB 223.58 KiB 0 B 0.00% ✅
Rum Shopify Profiler 8.17 KiB 8.17 KiB 0 B 0.00% ✅
Rum Shopify Recorder 4.85 KiB 4.85 KiB 0 B 0.00% ✅

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 78.10% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8632ce8 | Docs | View more details | Give us feedback!

@thomas-lebeau thomas-lebeau changed the title 👷 [RUM-19961] Publish npm packages with OIDC trusted publishing from GitHub Actions ci(release): Publish npm packages with OIDC trusted publishing Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #5275, which implements the same RUM-19961 change.

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant