Repository navigation
feat(publish-preview-oidc): allow publishing a subset of packages - #346
Merged
Merged
Conversation
Add a `packages` input that takes a comma-separated list of package names, and an `only-changed-packages` input that selects the packages changed compared to the base branch. Names without a scope get the source scope, and unknown names fail the build early. All packages are still built, and the selection only changes which ones are published.
The "Select packages to publish" step now prints "Packages to publish:" before the list of selected packages. This makes it clear in the log what the list is.
Mrtenz
marked this pull request as ready for review
November 19, 2026 12:18
4 tasks
Naz-Ovh
pushed a commit
to 0x-fork/metamask-core
that referenced
this pull request
Nov 20, 2026
…k#11682) ## Explanation The publish preview workflow currently publishes preview builds for every package in the monorepo. This adds two inputs to the workflow and passes them through to the reusable workflow: - `packages`: a comma-separated list of packages to publish (e.g., `@metamask/network-controller, permission-controller`). If left empty, all packages are published. - `only-changed-packages`: when enabled, publishes only the packages that changed relative to the base branch. Defaults to `true`. The two inputs can't be used together. ## References - MetaMask/github-tools#346 ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Workflow-only change with no runtime or data-handling impact; risk is limited to CI preview publish scope and depends on the external reusable workflow behaving as documented. > > **Overview** > Extends the **manual publish preview** workflow (`publish-preview.yml`) so runs no longer have to publish the entire monorepo by default. > > Two new `workflow_dispatch` inputs are wired through to `MetaMask/github-tools`’s `publish-preview-oidc` reusable workflow: **`packages`** (optional comma-separated allowlist; empty means all packages) and **`only-changed-packages`** (defaults to `true`, limits publishes to packages changed vs the base branch). The inputs are documented as **mutually exclusive**. > > This is CI configuration only; behavior depends on the shared workflow in github-tools (referenced in the PR). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit eab7370. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
publish-preview-oidcworkflow publishes every package in a monorepo. For large repositories likeMetaMask/core, that is often more than a change needs.This adds two optional inputs, passed through from
workflow_dispatch:packages: a comma-separated list of package names. Whitespace around names is trimmed, and names without a scope get the source scope, sofoo, barand@metamask/foo,barboth work. Unknown names fail the run before the build.only-changed-packages: publishes only the packages changed compared to the base branch of the pull request, or the default branch. The merge base comes from the GitHub API, so the workflow fetches only that commit and not the full history.The two inputs are mutually exclusive, and both are only supported in monorepos. The workflow still builds all packages and filters only the publish step. It does not publish previews of dependencies automatically, because a preview renames only the package itself and keeps the released
@metamask/*dependency ranges.The publish job takes the workspace list from its own
yarn workspaces listand uses the selected locations only to narrow it. The build job computes the selection and runs code from the PR, so the selection can never add packages to what gets published.Note
Medium Risk
Changes which packages are published to npm in CI; mis-selection or diff logic could publish the wrong subset, though defaults preserve publishing all packages when the new inputs are unset.
Overview
Monorepo preview publishes no longer have to push every workspace to npm.
publish-preview-oidcgains optionalpackages(comma-separated names, scope auto-filled fromsource-scope) andonly-changed-packages(workspaces with files changed since the PR base or default branch via merge-base diff). The inputs are mutually exclusive, monorepo-only, and validated up front.prepare-previewaccepts those inputs, runs a new Select packages to publish step when either is set, and exposes the chosen paths as apublish-locationsJSON output. The build still installs and builds the full repo; only the publish list is narrowed.The OIDC workflow’s monorepo Publish preview builds step filters
yarn workspaces listagainst that output instead of publishing every private workspace.CHANGELOGdocuments the feature.Reviewed by Cursor Bugbot for commit adbc329. Bugbot is set up for automated code reviews on this repo. Configure here.