Skip to content

Publish to npm with trusted publishing - #240

Merged
Refaerds merged 1 commit into
mainfrom
maryna/npm-trusted-publishing
Oct 13, 2026
Merged

Refaerds merged 1 commit into
mainfrom
maryna/npm-trusted-publishing

Conversation

@Refaerds

Copy link
Copy Markdown
Collaborator

Problem

The first release from the monorepo, cloudflare-puppeteer-v1.5.0-rc.0, failed at npm publish with npm error need auth (run 38365750713). The publish workflows read a NODE_AUTH_TOKEN secret that this repository does not have. Nothing was published.

Before the monorepo, @cloudflare/puppeteer (1.4.0) and @cloudflare/playwright (1.3.6) were published with npm trusted publishing (OIDC), not a token.

Change

  • The three publish workflows request an id-token and install npm 11.5.1 or later, which trusted publishing needs.
  • They no longer read NODE_AUTH_TOKEN.
  • RELEASING.md lists the trusted publisher settings that npmjs.com needs for each package.

Required before the next release

A package owner on npmjs.com must set a GitHub Actions trusted publisher for each package. Leave the environment empty.

Package Repository Workflow file
@cloudflare/puppeteer cloudflare/browser-run cf_puppeteer_publish.yml
@cloudflare/playwright cloudflare/browser-run cf_playwright_publish.yml
@cloudflare/playwright-mcp cloudflare/browser-run cf_playwright_mcp_publish.yml

The Puppeteer and Playwright packages have trusted publishers for the old repositories and workflow files. @cloudflare/playwright-mcp 0.0.5 was published manually and has no trusted publisher yet.

After merge

  1. Wait for the full suites on main. The publish workflows require them for the release commit.
  2. Delete the GitHub release and tag cloudflare-puppeteer-v1.5.0-rc.0. A rerun of the failed run uses the old workflow.
  3. Create the prerelease again from the new main commit. Version 1.5.0-rc.0 is still unpublished.

The publish workflows read a NODE_AUTH_TOKEN secret that does not exist, so
the first release failed with 'need auth'. Before the monorepo, packages
were published with npm trusted publishing (OIDC). Request an id-token,
install npm 11.5.1 or later, and document the trusted publisher settings
that npmjs.com needs for each package after the rename to
cloudflare/browser-run.
@github-actions

Copy link
Copy Markdown

@cloudflare/playwright-mcp preview for commit d29707f

npm i https://pkg.pr.new/cloudflare/browser-run/@cloudflare/playwright-mcp@d29707f7ee064864289ebdbdc066055cc810f8c6

Published by this workflow run. New pushes and reruns update this comment.

@github-actions

Copy link
Copy Markdown

@cloudflare/playwright preview for commit d29707f

npm i https://pkg.pr.new/cloudflare/browser-run/@cloudflare/playwright@d29707f7ee064864289ebdbdc066055cc810f8c6

Published by this workflow run. New pushes and reruns update this comment.

@github-actions

Copy link
Copy Markdown

@cloudflare/puppeteer preview for commit d29707f

npm i https://pkg.pr.new/cloudflare/browser-run/@cloudflare/puppeteer@d29707f7ee064864289ebdbdc066055cc810f8c6

Published by this workflow run. New pushes and reruns update this comment.

@Refaerds
Refaerds merged commit 5f0ffea into main Oct 13, 2026
10 of 12 checks passed
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.

1 participant