Skip to content

Issues with env.LOCKFILE when package-manager input is explicitly specified but there is no package manager cache #98

Description

@pekkanikander

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

  1. Use a repo where the lockfile is not committed (e.g.yarn.lock is in .gitignore)
  2. Set package-manager: yarn explicitly in the workflow
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions