ci: stop setup-node saving a pnpm store the job never created - #1104
Merged
Conversation
yasin-ce
marked this pull request as ready for review
July 30, 2026 19:00
wjbeau
approved these changes
Jul 30, 2026
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.
Description
Removes
cache: "pnpm"from everysetup-nodebelowsetup, so a job can no longer fail while saving a pnpm store it never created.setup-node's post-step saves the pnpm store. Jobs belowsetuprestorenode_modulesfrom the cachesetupsaved, sotest -d node_modules || pnpm installskips the install — and the store is only ever created bypnpm install. Whensetup-node's own store cache also missed, the post-step tried to save a path that does not exist and failed the job with:That happens in
Post Setup Node, i.e. after the job's real work has already passed — the test shards reported failure on runs where all 4155 tests passed. It hit #1081, #1093 and #1096; it spared other PRs only because their store cache happened to hit.The
auditjob already fixed this the same way and documented it. This applies that precedent to the remaining five jobs and promotes the explanation to the rule it always was, so the next job added belowsetupdoesn't reintroduce it.setupkeepscache: "pnpm"— it installs unconditionally, so its store exists and is worth caching run-over-run.Related Issues
Checklist
Additional Notes
On the unticked boxes. A workflow change can't be exercised locally, and
pull_requestruns use the workflow from the PR branch — so this PR's own checks are the first real test, and the fix only protects other PRs once it is onmain. What I could verify locally: the YAML parses, and a structural pass over every job confirms none now pairscache: "pnpm"with a skipped install.lint,format --check,lint:copyrightandlint:i18npass. No source or test files are touched, so there is nothing to add a test for.Why remove the cache rather than create the directory. The first version of this added
mkdir -p "$(pnpm store path)"so the save would find an empty directory. That also works and keeps the store warm for the rare path where a downstream job misses thenode_modulescache and does install. I dropped it because these jobs never read the store — every step runs against already-installednode_modules(pnpm run …,pnpm --filter … exec …), so restoring it was download-and-extract work that nothing consumed, and adding a second remedy for something this file already solves one way is worse than applying the existing one.The one store consumer.
expo:prebuildends inpnpm dlx pod-install ios, andpnpm dlxdoes resolve from the registry — one small package now fetched cold on thebuildjob instead of hardlinked.Residual risk. A downstream job that misses the
node_modulescache willpnpm installwithout a warm store, which is slower. All five areneeds: setup(directly or viabuild) andsetupsaves that cache under the lockfile-hashed key in the same run before they start, so a miss needs eviction or a failed save in the minutes between. It costs one slower job, not a failed one.