File tree Expand file tree Collapse file tree
.github/actions/node-setup Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 uses : actions/setup-node@v6
1616 with :
1717 node-version : ${{ inputs.node-version }}
18- cache : ' pnpm'
1918
19+ - name : Get pnpm store path
20+ id : pnpm-store
21+ shell : bash
22+ run : echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
23+
24+ # Restore-keys fall back to the closest prior store even when the lockfile
25+ # hash doesn't match exactly, so PRs reuse main's store instead of
26+ # installing from scratch.
27+ - name : Restore pnpm store
28+ uses : actions/cache/restore@v4
29+ with :
30+ path : ${{ steps.pnpm-store.outputs.path }}
31+ key : pnpm-store-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
32+ restore-keys : |
33+ pnpm-store-${{ runner.os }}-
2034
2135 - name : Install dependencies
2236 shell : bash
2943 - name : Prune pnpm store
3044 shell : bash
3145 run : pnpm store prune
46+
47+ # Only main writes new cache entries — PRs restore-and-reuse but never
48+ # save, so open PRs stop each spawning their own throwaway ~700MB entry.
49+ - name : Save pnpm store
50+ if : github.ref == 'refs/heads/main'
51+ uses : actions/cache/save@v4
52+ with :
53+ path : ${{ steps.pnpm-store.outputs.path }}
54+ key : pnpm-store-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
You can’t perform that action at this time.
0 commit comments