Skip to content
This repository was archived by the owner on Sep 26, 2026. It is now read-only.

fix(ci): enable corepack before Setup Node so the pnpm cache resolves - #2

Open
danjdewhurst wants to merge 1 commit into
mainfrom
fix/ci-corepack-before-setup-node
Open

danjdewhurst wants to merge 1 commit into
mainfrom
fix/ci-corepack-before-setup-node

Conversation

@danjdewhurst

@danjdewhurst danjdewhurst commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Found by the weekly maintenance sweep. ci has been failing on main since 2026-04-18 — the last run on the default branch is 24613931302, and the failing step is Setup Node, step 3.

Cause

actions/setup-node with cache: pnpm resolves the cache directory by shelling out to pnpm store path. In the current workflow that step runs before corepack enable, so there is no pnpm on PATH yet and the cache probe fails the step before anything is installed.

package.json declares "packageManager": "pnpm@10.33.0", so pnpm only exists once corepack has been enabled.

Fix

Move Enable corepack ahead of Setup Node. This is the ordering actions/setup-node documents for corepack-managed package managers: the corepack shim lands in the system npm prefix, which stays on PATH after setup-node prepends its own toolchain, so the cache probe resolves.

One-line reorder, no other change, no new action dependencies.

Verification

Not verified by CI on this branch. GitHub Actions jobs in this org are currently not starting at all — they fail in a few seconds with zero steps executed, which is a billing / spending-limit block rather than a code problem. The same signature is visible right now on forjd/polar, forjd/sl-rp-web and forjd/qa. Until that clears, this PR's checks will not be meaningful either.

Reviewed by reading the workflow and package.json rather than by a green run. Flagging that explicitly so it is a conscious call at merge time.

Not merging this — handing it over for sign-off.

`actions/setup-node` with `cache: pnpm` shells out to `pnpm store path` to
locate the cache directory. That ran before `corepack enable`, so no `pnpm`
binary existed yet and the Setup Node step failed. `ci` has been red on `main`
since 2026-04-18 for this reason.

Moving `corepack enable` ahead of Setup Node makes the shim available when the
cache probe runs. No other change.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Enable Corepack before pnpm cache setup in CI

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 5 minutes

Grey Divider

AI Description

• Enables Corepack before Node setup so pnpm cache discovery succeeds.
• Keeps dependency installation and validation steps otherwise unchanged.
Diagram

sequenceDiagram
  participant R as CI Runner
  participant C as Corepack
  participant N as Setup Node
  participant P as pnpm
  R->>C: Enable shim
  C-->>R: pnpm on PATH
  R->>N: Configure Node cache
  N->>P: Resolve store path
  P-->>N: Return cache directory
Loading
High-Level Assessment

The reordered workflow is the most direct fix because setup-node requires pnpm on PATH while resolving its cache. Disabling caching or installing pnpm separately would either reduce CI performance or duplicate the package-manager version already managed through Corepack.

Files changed (1) +3 / -3

Bug fix (1) +3 / -3
ci.ymlEnable Corepack before setup-node cache discovery +3/-3

Enable Corepack before setup-node cache discovery

• Moves 'corepack enable' ahead of 'actions/setup-node'. This makes the package.json-pinned pnpm shim available when setup-node invokes 'pnpm store path' to configure caching.

.github/workflows/ci.yml

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant