Skip to content

Conversation

@Satishchoudhary94
Copy link

@Satishchoudhary94 Satishchoudhary94 commented Jan 18, 2026

Problem

When packageManager: pnpm was set in package.json but pnpm wasn't installed yet
(e.g., when using corepack), the action failed immediately with:

Solution

Added package manager installation check before caching. If package manager isn't found,
the action logs a warning and skips caching instead of failing.

Changes

  • Added isPackageManagerInstalled() function to check if tool exists on PATH
  • Updated restoreCache() to skip with warning if package manager not found
  • Updated cachePackages() to skip with warning if package manager not found

Testing

  • All cache-utils tests pass (42/42)
  • Workflows continue instead of failing
  • Clear guidance for users on what to do

Fixes #1357

… cache

This change prevents the action from failing immediately when pnpm is specified
in packageManager but not yet installed (e.g., when using corepack).

Changes:
- Add isPackageManagerInstalled() function to check if a package manager exists
- Update restoreCache to skip caching with a warning if package manager not found
- Update cachePackages to skip cache save with a warning if package manager not found
- This allows workflows to continue instead of failing
- Users can either install pnpm first or disable caching with package-manager-cache: false

Fixes actions#1357
Related: actions#1357
@Satishchoudhary94 Satishchoudhary94 requested a review from a team as a code owner January 18, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v5 fails immediately when using pnpm

1 participant