Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ hashFiles('**/package-lock.json') != '' && 'npm' || '' }}
# `actions/setup-node` looks for the lock file at the repo root unless
# `cache-dependency-path` is provided. `**/package-lock.json` matches
# subdir lock files (e.g. `frontend/package-lock.json`) and would
# cause setup-node to fail with "Dependencies lock file is not found"
# when the root has no lock. Restrict to root files only.
cache: ${{ hashFiles('package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock') != '' && 'npm' || '' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: yarn.lock in the hash check will trigger the same "lock file not found" error for yarn-only repos.

actions/setup-node with cache: 'npm' looks for package-lock.json or npm-shrinkwrap.json at the repo root — it does not accept yarn.lock as proof of an npm install. So a repo that has only yarn.lock at root will:

  1. Hash it → non-empty → expression evaluates to 'npm'
  2. setup-node searches for package-lock.json / npm-shrinkwrap.json at root
  3. Neither exists → "Dependencies lock file is not found" — the exact error this PR is fixing

Since the cache type is always hardcoded to 'npm', only npm lock files should gate the check:

Suggested change
cache: ${{ hashFiles('package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock') != '' && 'npm' || '' }}
cache: ${{ hashFiles('package-lock.json', 'npm-shrinkwrap.json') != '' && 'npm' || '' }}


# If the target repo has a prettier config that references plugins
# (e.g. prettier-plugin-svelte), prettier needs the project's
Expand Down
Loading