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
{{ message }}
Repository navigation
Use @actions/tool-cache to manage pnpm versions instead of forcing download #269
I looked at the current install approach in src/install-pnpm/run.ts. The bootstrap mechanism uses committed lockfiles (pnpm-lock.json + exe-lock.json) for supply chain integrity — npm resolves every dependency against those pinned hashes, so there is no opportunity for a package registry compromise to inject bad code.
Switching to @actions/tool-cache would replace that with a download-and-cache approach. The trade-offs:
Performance: on self-hosted runners with cold caches, tool-cache's download is similar to npm ci. On GitHub-hosted runners the npm bootstrap cache is already warm from every prior run. On self-hosted runners with a warm tool-cache, tool-cache skips the download entirely — this is the one real win.
Security: tool-cache does not have a built-in integrity-verified bootstrap chain. You would need to verify checksums yourself, and the current lockfile approach cannot be replicated with tool-cache.
Version resolution: the current readTargetVersion logic (packageManager, devEngines, version input) would still work, but self-update becomes unnecessary since tool-cache extracts the right version directly.
The biggest practical benefit would be eliminating the bootstrap-layer complexity — no more committed lockfiles, no self-update step, no bootstrap pnpm at all. The risk is losing the integrity guarantees unless checksums are verified manually. If that trade-off is acceptable, the cleanest approach would be to download the pnpm standalone binary from the registry and verify its shasum inline.
+1 from a team on self-hosted runners with pnpm 12. Since packageManager pins an exact version, the bootstrap (12.3.4 in v6.1.0) never matches, so every job runs self-update to 12.10.1.
On warm runners that's ~3.5 s, but in a job container where nothing persists it was ~17.6 s per job. With a sharded matrix we pay that once per shard.
Could the verified bootstrap + self-update stay the only way pnpm gets installed, with the result cached via @actions/tool-cache by exact version? The first job on a runner would still be fully verified, and later jobs would skip the download.
Activity
cschanhniem commentedon Jun 19, 2026
I looked at the current install approach in src/install-pnpm/run.ts. The bootstrap mechanism uses committed lockfiles (pnpm-lock.json + exe-lock.json) for supply chain integrity — npm resolves every dependency against those pinned hashes, so there is no opportunity for a package registry compromise to inject bad code.
Switching to @actions/tool-cache would replace that with a download-and-cache approach. The trade-offs:
Performance: on self-hosted runners with cold caches, tool-cache's download is similar to npm ci. On GitHub-hosted runners the npm bootstrap cache is already warm from every prior run. On self-hosted runners with a warm tool-cache, tool-cache skips the download entirely — this is the one real win.
Security: tool-cache does not have a built-in integrity-verified bootstrap chain. You would need to verify checksums yourself, and the current lockfile approach cannot be replicated with tool-cache.
Version resolution: the current readTargetVersion logic (packageManager, devEngines, version input) would still work, but self-update becomes unnecessary since tool-cache extracts the right version directly.
The biggest practical benefit would be eliminating the bootstrap-layer complexity — no more committed lockfiles, no self-update step, no bootstrap pnpm at all. The risk is losing the integrity guarantees unless checksums are verified manually. If that trade-off is acceptable, the cleanest approach would be to download the pnpm standalone binary from the registry and verify its shasum inline.
etaMS20 commentedon Oct 22, 2026
+1 from a team on self-hosted runners with pnpm 12. Since
packageManagerpins an exact version, the bootstrap (12.3.4 in v6.1.0) never matches, so every job runsself-updateto 12.10.1.On warm runners that's ~3.5 s, but in a job container where nothing persists it was ~17.6 s per job. With a sharded matrix we pay that once per shard.
Could the verified bootstrap + self-update stay the only way pnpm gets installed, with the result cached via
@actions/tool-cacheby exact version? The first job on a runner would still be fully verified, and later jobs would skip the download.threeal commentedon Nov 10, 2026
I don't mean to endorse this, but while this action still not using
RUNNER_TOOL_CACHE, you can try this action instead.