Skip to content

ci: migrate npm publish to OIDC trusted publishing - #83

Open
joaoloureirop wants to merge 4 commits into
mainfrom
ci/oidc-trusted-publishing
Open

joaoloureirop wants to merge 4 commits into
mainfrom
ci/oidc-trusted-publishing

Conversation

@joaoloureirop

@joaoloureirop joaoloureirop commented Sep 15, 2026

Copy link
Copy Markdown

Summary

  • Update the publish workflow to MetaMask/action-npm-publish@v6 with OIDC (id-token: write) and staged NPM publishing.
  • Upgrade the repo to Yarn 4.16 so the v6 publish action can run, and point CI installs at Corepack + yarn --immutable.
  • Publish the built lib output (this is a single package, not a packages/**/dist monorepo).

Follow-up

  • Confirm trusted publishing is configured on npm for @metamask/react-native-webview (workflow publish-release.yml, environment npm-publish).
  • After the first OIDC publish succeeds, NPM_TOKEN can be removed from the npm-publish environment.

Test plan

  • Confirm CI install jobs still succeed with Yarn 4 / Corepack.
  • Dry-run the Publish Release workflow and check the Slack dry-run announcement.
  • Confirm the real publish job requests OIDC and does not need a long-lived token after trusted publishing is set.

Made with Cursor

Upgrade action-npm-publish to v6 and Yarn 4.16 so releases can use staged OIDC publishes instead of long-lived tokens.

Co-authored-by: Cursor <cursoragent@cursor.com>
@socket-security

socket-security Bot commented Sep 15, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • tinyglobby@0.2.17
  • undici@8.10.2
  • node-gyp@13.0.2
  • proc-log@7.0.0
  • tar@7.5.22

View full report

actions/setup-node resolves the runner's global Yarn 1 when populating the
yarn cache, which now refuses to run because package.json requires Yarn 4.

Also build with `yarn prepare` so the published package keeps its type
declarations, and keep Yarn's hardened install defaults.

Co-authored-by: Cursor <cursoragent@cursor.com>
@joaoloureirop

Copy link
Copy Markdown
Author

@SocketSecurity ignore npm/undici@8.10.2
@SocketSecurity ignore npm/node-gyp@13.0.2
@SocketSecurity ignore npm/proc-log@7.0.0
@SocketSecurity ignore npm/tar@7.5.22
@SocketSecurity ignore npm/tinyglobby@0.2.17

Transitive tooling from the existing React Native 0.73 example stack, surfaced by the Yarn 4 lockfile rewrite. Not new direct deps and not in the published package.

undici is Node's HTTP client (network + proxy env vars are its job).
node-gyp is the native addon build toolchain (subprocess during builds is expected).
tar/proc-log/tinyglobby are standard npm/RN install tooling.

@joaoloureirop
joaoloureirop marked this pull request as ready for review September 15, 2026 15:23

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please align the workflows more with the module template?

publish-release is typically called through the main workflow, and releases are created through the create-release-pr workflow.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a separate PR is fine too.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. publish-release.yml is now a workflow_call invoked from main.yml after action-is-release, and releases are opened via create-release-pr.yml.

This repo already has Android/iOS/Detox/security workflows, so main.yml only covers the release trigger rather than duplicating the full module-template CI graph. Formatter is prettier to match this package.

Comment thread package.json Outdated
joaoloureirop and others added 2 commits September 15, 2026 18:21
Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
Signed-off-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>
Align the release flow with the module template: open a release PR from
the Create Release Pull Request workflow, then publish when that
github-actions commit lands on main.

Co-authored-by: Cursor <cursoragent@cursor.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.

2 participants