When package-manager is explicitly set (e.g. package-manager: yarn), the "Check lockfiles" step in action.yml sets PACKAGE_MANAGER but never sets LOCKFILE. The auto-detection branches all set both; the explicit branch sets only one.
This causes cache-dependency-path in the "Setup Node" step to evaluate to "./" (a bare directory), which actions/setup-node
glob expands recursively to every file in the workspace, spawning a potentially large number of concurrent NodeJS processes, which in turn corrupts V8's startup snapshot cache and produces fatal crashes. See actions/setup-node#887
Steps to reproduce
- Use a repo where the lockfile is not committed (e.g.
yarn.lock is in .gitignore)
- Set
package-manager: yarn explicitly in the workflow
- Run the action — the Setup Node step crashes
Expected behaviour
The cache-dependency-path should resolve to the lockfile path (e.g. ./yarn.lock),
identical to the existing auto-detection path.
If the lockfile is absent, caching should be skipped gracefully with a warning, rather than crashing.
Note well
This issue has been prepared with the help of Claude Code and ChatGPT Codex. I'm working on a fix with them and hope to land a PR soon, after some more testing.
When
package-manageris explicitly set (e.g.package-manager: yarn), the "Check lockfiles" step inaction.ymlsetsPACKAGE_MANAGERbut never setsLOCKFILE. The auto-detection branches all set both; the explicit branch sets only one.This causes
cache-dependency-pathin the "Setup Node" step to evaluate to"./"(a bare directory), whichactions/setup-nodeglob expands recursively to every file in the workspace, spawning a potentially large number of concurrent NodeJS processes, which in turn corrupts V8's startup snapshot cache and produces fatal crashes. See actions/setup-node#887
Steps to reproduce
yarn.lockis in.gitignore)package-manager: yarnexplicitly in the workflowExpected behaviour
The
cache-dependency-pathshould resolve to the lockfile path (e.g../yarn.lock),identical to the existing auto-detection path.
If the lockfile is absent, caching should be skipped gracefully with a warning, rather than crashing.
Note well
This issue has been prepared with the help of Claude Code and ChatGPT Codex. I'm working on a fix with them and hope to land a PR soon, after some more testing.