Skip to content

Commit 9899b47

Browse files
t3dotggclaude
andauthored
ci: stacked PRs stop evicting the shared pnpm cache (#31937)
A PR based on a branch other than the default saved a ~1 GB pnpm store that only its own reruns can read, which evicted shared entries. These PRs still restore and install; pushes, releases, and default-base PRs save as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c8267db commit 9899b47

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎.github/actions/setup-ci-deps/action.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@ runs:
123123
key: ${{ steps.pnpm_verified.outputs.cache-primary-key }}
124124

125125
# A filtered install that started from the current full store adds nothing
126-
# worth a second copy of it.
126+
# worth a second copy of it. A stacked PR, based on a branch other than the
127+
# default, saves a ~1 GB store only its own reruns can read, so it only restores.
127128
- name: Save pnpm store
128129
if: >-
129130
inputs.install == 'true' &&
131+
(github.event_name != 'pull_request' || github.base_ref == github.event.repository.default_branch) &&
130132
steps.pnpm_cache.outputs.cache-hit != 'true' &&
131133
(steps.pnpm_store.outputs.namespace == 'full' ||
132134
steps.pnpm_cache.outputs.cache-matched-key != format('pnpm-full-v1-{0}-{1}-{2}', runner.os, runner.arch, hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json')))

0 commit comments

Comments
 (0)