Skip to content

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

Closed
thomas-lebeau wants to merge 2 commits into
mainfrom
thomas.lebeau/oidc-npm-trusted-publishing-rum-19961-31ef6843
Closed

thomas-lebeau wants to merge 2 commits into
mainfrom
thomas.lebeau/oidc-npm-trusted-publishing-rum-19961-31ef6843

Conversation

@thomas-lebeau

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

Copy link
Copy Markdown
Collaborator

Motivation

We publish the 14 public npm packages from GitLab with a long-lived npm token. 2FA-bypass tokens stop working in January 2027, so releases need to publish with OIDC trusted publishing from GitHub Actions instead, with no stored token. The GitLab deploy pipeline still decides when publishing happens: after the CDN regions, behind the cordon check, and before the developer extension.

Jira: RUM-19961

Changes

  • New .github/workflows/publish-npm.yml workflow, started by hand with a version input in the npm-publish environment, with id-token: write. It checks that the run is on tag refs/tags/<version> and that package.json has that version. Then it sets up Node 24, runs yarn install --immutable and runs publish-npm.ts.
  • publish-npm.ts: on GitHub Actions it skips the stored token, so yarn authenticates through OIDC and publishes with --provenance. Anywhere else it still fetches the npm token from SSM, as before.
  • New tag-only dd-octo-sts policy, self.gitlab.publish.sts.yaml (actions: write).
  • GitLab step-6_publish-npm (auto and manual) keeps the cordon check, then runs the new dispatch-publish-npm.ts. That script starts the workflow on vX.Y.Z with return_run_details, prints the run URL, checks the run every 15 seconds for up to 45 minutes, and fails unless the run succeeds.

The npm token secret and renew-token.ts stay in place for now.

Not verified until a real release: the dispatch API returning run details, a run started with the octo-sts token passing the environment's tag rule, and yarn's OIDC publish working end to end.

Needed before the first release (outside this repo):

  • Register the 14 packages for trusted publishing on npm.
  • Create the npm-publish environment, restricted to v* tags.

After the first successful release: enforce 2FA, delete the token secret and renew-token.ts, and update the docs.

Test instructions

  • node --test --experimental-test-module-mocks scripts/deploy/publish-npm.spec.ts scripts/deploy/dispatch-publish-npm.spec.ts passed 8/8 (local). The dispatch tests mock the GitHub API and the dd-octo-sts commands and fake the clock. They cover the POST body, success after pending polls, failure and cancelled runs rejecting, an API error rejecting, the 45-minute timeout, and the token being revoked in every case.
  • GITHUB_ACTIONS=true node scripts/deploy/publish-npm.ts --dry-run (local) exited 0. It built and checked all 14 packages without fetching a token; each was skipped as already published (7.17.1). A dry run leaves out --provenance.
  • Lint and yarn typecheck are clean (local).

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

@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-datadog-prod-us1-2

datadog-datadog-prod-us1-2 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.01% (-0.09%)

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

@thomas-lebeau thomas-lebeau changed the title 👷 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