Skip to content

feat: Add skip-install input#74

Merged
Mrtenz merged 2 commits into
mainfrom
mrtenz/skip-install
Jun 11, 2026
Merged

feat: Add skip-install input#74
Mrtenz merged 2 commits into
mainfrom
mrtenz/skip-install

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Jun 11, 2026

Copy link
Copy Markdown
Member

Explanation

The action currently always runs yarn install (and surrounding cache lookups) as part of its setup. There are workflows that only need the repository checked out and Node.js available — for example, publishing to npm, where Node.js is required to run the publish action but installing the package's dependencies is undesirable from a supply-chain-security perspective. For those workflows, the install step is both wasted time and unnecessary attack surface.

This adds a new skip-install input (default false). When set to true, the action still performs the checkout and Node.js setup (including corepack enable and yarn hydration, so yarn itself is available), but skips:

  • The yarn.lock download and try-skip-setup cache lookup
  • The node_modules cache restore
  • The setup-node yarn cache restore
  • yarn --immutable
  • yarn allow-scripts
  • The post-install cache save

A new test-skip-install job in build-lint-test.yml exercises the new path and asserts that Node.js is set up, node_modules is absent, and no caches were consulted.


Note

Low Risk
Opt-in CI behavior change with default unchanged; reduces install surface when enabled rather than altering existing install paths.

Overview
Adds a skip-install action input (default false) so workflows can get checkout + Node.js (and Corepack/Yarn hydration) without installing dependencies or touching install caches.

When skip-install: true, the composite action skips yarn.lock prefetch, node_modules cache lookup/restore/save, setup-node yarn cache, yarn --immutable, and yarn allow-scripts. README documents the option; test-skip-install in CI asserts Node is configured, node_modules is absent, and cache outputs are not hit.

Reviewed by Cursor Bugbot for commit 640ad34. Bugbot is set up for automated code reviews on this repo. Configure here.

Mrtenz added 2 commits June 11, 2026 09:39
When set to `true`, the action checks out the repository and sets up
Node.js, but skips all Yarn install steps (cache lookups, install,
allow-scripts, and cache save). This is useful when a workflow only
needs Node.js available and manages its own dependency installation.
GitHub Actions needs `action.yml` on disk before it can resolve `uses:
./`, so a pre-checkout step is required like in every other test job.
@Mrtenz Mrtenz marked this pull request as ready for review June 11, 2026 08:15
@Mrtenz Mrtenz requested a review from a team as a code owner June 11, 2026 08:15
@Mrtenz Mrtenz merged commit 3c2ec75 into main Jun 11, 2026
36 checks passed
@Mrtenz Mrtenz deleted the mrtenz/skip-install branch June 11, 2026 10:08
pull Bot pushed a commit to dmrazzy/core that referenced this pull request Jun 11, 2026
## Explanation

The `check-release` composite action invokes `yarn workspaces list` to
enumerate published packages, but the job calling it never sets up the
project's pinned Yarn version. As a result, the runner's global Yarn
1.22.22 is used, which fails against the `packageManager` field in
`package.json` (`yarn@4.16.0`) with:

> This project's package.json defines "packageManager": "yarn@4.16.0".
However the current global version of Yarn is 1.22.22.

This PR replaces the standalone `actions/checkout@v5` step with
`MetaMask/action-checkout-and-setup@v3`, which sets up Node and Yarn via
Corepack. The new [`skip-install:
true`](MetaMask/action-checkout-and-setup#74)
input (added in v3.4.0) skips `yarn install`, which this action does not
need — it only needs `yarn workspaces list`, which reads workspace globs
from `package.json` directly.

## References

- Added in
[MetaMask/action-checkout-and-setup#74](MetaMask/action-checkout-and-setup#74)
(released in v3.4.0)

## 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**
> CI-only workflow changes; no application runtime or release publish
logic is modified.
> 
> **Overview**
> Fixes the **check-release** composite action failing when it runs
`yarn workspaces list` because the runner used global Yarn 1.x instead
of the repo’s pinned **Yarn 4** from `packageManager`.
> 
> The action’s checkout step is replaced with
**`MetaMask/action-checkout-and-setup@v3`**, enabling Corepack/Yarn
without running **`yarn install`** (`skip-install: true`). In
**`main.yml`**, the **check-release** job’s checkout now uses
**`fetch-depth: 0`** so merge-base/git history checks still work after
checkout moved out of the composite action.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f178d76. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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