Skip to content

fix: add package-lock.json for cache key + cache boolean input - #9

Merged
mayurrawte merged 1 commit into
masterfrom
fix/test-lockfile-cache-input
May 21, 2026
Merged

mayurrawte merged 1 commit into
masterfrom
fix/test-lockfile-cache-input

Conversation

@mayurrawte

Copy link
Copy Markdown
Owner

Root cause

actions/setup-node@v4 with cache: npm (or yarn/pnpm) requires a lock file to build the cache key. We deleted package.json/package-lock.json in v2, so all test jobs failed with:

Dependencies lock file is not found. Supported file patterns: package-lock.json,npm-shrinkwrap.json,yarn.lock

Fix

  • Added minimal package.json + generated package-lock.json back to the repo (no dependencies, just metadata)
  • Added cache boolean input to action.yml (default: true) — lets users disable caching when they have no lock file
  • Cache is now conditionally passed to actions/setup-node: cache == 'true' && package-manager || ''
  • Updated README inputs table

@mayurrawte
mayurrawte merged commit ce6e7ca into master May 21, 2026
2 of 13 checks passed
@mayurrawte
mayurrawte deleted the fix/test-lockfile-cache-input branch May 21, 2026 07:43
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.

1 participant