Skip to content

ci: Use OIDC for npm publish - #41900

Draft
sampaiodiego wants to merge 7 commits into
developfrom
use-oidc-for-npm-publish
Draft

ci: Use OIDC for npm publish#41900
sampaiodiego wants to merge 7 commits into
developfrom
use-oidc-for-npm-publish

Conversation

@sampaiodiego

@sampaiodiego sampaiodiego commented Aug 21, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Review in cubic

sampaiodiego and others added 4 commits August 21, 2026 17:41
npm generates provenance attestations automatically when publishing with
trusted publishing (OIDC), and rejects the publish when `repository.url`
is missing or does not match the repository the workflow ran in.

Six published packages had no `repository` field at all; `message-parser`
and `peggy-loader` still pointed at `RocketChat/fuselage`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`createNpmFile()` interpolated `process.env.NPM_TOKEN` unconditionally, so
without the secret it wrote `//registry.npmjs.org/:_authToken=undefined`.
npm honours that auth line instead of exchanging the OIDC token, failing
with a misleading E401/E404.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
npm allows one trusted publisher per package and validates the entry-point
workflow filename (`workflow_ref`), which rules out `workflow_call` reusable
workflows. Publishing happened from three files — publish-release.yml,
new-release.yml and release-candidate.yml — so no single filename could be
registered.

Merge them into release.yml, keeping all three triggers and deriving the
release-action `action` from the event. Also grant `id-token: write` and
install npm >= 11.5.1, both required for the OIDC exchange (Node 22 bundles
npm 10).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Covers what release.yml does, why publishing must live in a single workflow
file, how to register a trusted publisher for a package, the repository-field
requirement for provenance, and the common OIDC failure modes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dionisio-bot

dionisio-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0ade3bc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a38be13b-78bc-4133-b365-26defebf8291

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

sampaiodiego and others added 2 commits August 21, 2026 17:58
`.changeset/config.json` already sets `access: "public"` globally, which
changesets turns into `--access public` on every `npm publish`. The nine
per-package copies were inconsistent — the other six published packages never
had one — and the copy in `fuselage-ui-kit` was dead, since that package is
private.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`using: "node20"` is a deprecated GitHub Actions runtime. Bump the esbuild
target alongside it so the bundle matches the runtime it executes on.

This does not affect the OIDC exchange either way — the publish runs in a
subprocess (`yarn changeset publish`) under the Node from setup-node, and
inherits `ACTIONS_ID_TOKEN_REQUEST_*` from the job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.32%. Comparing base (2a7de45) to head (0ade3bc).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41900      +/-   ##
===========================================
- Coverage    69.33%   69.32%   -0.01%     
===========================================
  Files         4255     4255              
  Lines       168644   168644              
  Branches     30052    30030      -22     
===========================================
- Hits        116929   116920       -9     
- Misses       46534    46544      +10     
+ Partials      5181     5180       -1     
Flag Coverage Δ
e2e 58.87% <ø> (+0.06%) ⬆️
e2e-api 45.87% <ø> (+0.02%) ⬆️
unit 71.25% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

It declared `yarn@4.12.0` while the root declares `4.18.0`. No other
workspace package pins a package manager, and this one already inherits the
toolchain via `volta.extends`, so remove the field rather than bump it —
otherwise it just drifts again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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