You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Key design choice: These two new caches intentionally do not include ${{ github.run_id }} in the primary key (unlike the Yarn global cache and install state entries). That's correct here — you want an exact cache hit when lock files are unchanged, so the link/build step is skipped on the next run. The existing caches use run_id because they benefit from always being refreshed; node_modules only needs updating when dependencies actually change.
This PR extends the set-up-yarn-cache composite action to also cache node_modules directories, complementing the existing yarn global cache and install-state caches. Since the repo uses nodeLinker: node-modules (confirmed in .yarnrc.yml), caching node_modules directly avoids Yarn's link/hoist step on cache hits, which can be a significant time saving in CI.
Adds a cache step for the root node_modules keyed on yarn.lock, package.json, and .yarnrc.yml hashes — correctly includes .yarnrc.yml since linker config changes affect the installed layout.
Adds a separate cache step for packages/create-cedar-rsc-app/node_modules, which has its own yarn.lock (a standalone sub-workspace). The key omits .yarnrc.yml — correct, since packages/create-cedar-rsc-app does not have its own .yarnrc.yml.
Both new steps use actions/cache@v5, consistent with the existing steps in the action.
The broad restore-keys fallback (node-modules-${{ runner.os }}-) is standard practice; a partial hit still allows yarn install to patch up any differences before proceeding.
Confidence Score: 5/5
Safe to merge — a targeted CI caching improvement with no impact on application code or correctness.
The change is confined to a single composite action file, uses the same actions/cache@v5 version already in use, and the cache keys are correctly derived from the relevant lock files and config. The repo's nodeLinker: node-modules setting confirms that caching node_modules is the right strategy. No logic or application code is touched.
No files require special attention.
Important Files Changed
Filename
Overview
.github/actions/set-up-yarn-cache/action.yml
Adds two new cache steps for root node_modules and packages/create-cedar-rsc-app/node_modules; straightforward and correct for the nodeLinker: node-modules setup confirmed in .yarnrc.yml.
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[set-up-yarn-cache action] --> B[Get yarn cache directory]
B --> C[Cache yarn's global cache\nyarn-cache-OS-run_id]
C --> D[Cache yarn install state\nyarn-install-state-OS-hash-run_id]
D --> E["♻️ Cache root node_modules\nnode-modules-OS-hash(yarn.lock,package.json,.yarnrc.yml)"]
E --> F["♻️ Cache create-cedar-rsc-app node_modules\nnode-modules-create-cedar-rsc-app-OS-hash(yarn.lock,package.json)"]
style E fill:#90EE90
style F fill:#90EE90
Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci
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
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.
From AI's reasoning