Skip to content

Commit ca922da

Browse files
committed
ci: only cache the pnpm store when setup installs dependencies
The layering-guard job uses setup-node-pnpm with install-deps: false, so it never creates a pnpm store. setup-node's post-job cache save then fails with a path validation error whenever the lockfile hash misses the cache - which any lockfile-changing PR does. Gate the cache on install-deps so no-install jobs skip pnpm store caching entirely. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FqeW8sA2ZnvnftdvpCqFMS
1 parent fa5c8ae commit ca922da

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/actions/setup-node-pnpm/action.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ runs:
2727
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
2828
with:
2929
node-version: ${{ inputs.node-version }}
30-
cache: 'pnpm'
30+
# Only cache the pnpm store when this action also installs dependencies.
31+
# Jobs with install-deps: false never create the store, and on a cache
32+
# miss (any lockfile-changing PR) the post-job cache save fails the job.
33+
cache: ${{ inputs.install-deps == 'true' && 'pnpm' || '' }}
3134

3235
- name: Install dependencies
3336
if: ${{ inputs.install-deps == 'true' }}

0 commit comments

Comments
 (0)