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
1 change: 1 addition & 0 deletions .github/workflows/cancel-event.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v6
with:
cache-dependency-path: '**/package-lock.json'
Comment on lines 19 to 22
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

actions/setup-node@v6 cache-dependency-path parameter documentation

💡 Result:

In actions/setup-node@v6, cache-dependency-path is an input used to tell the action which dependency/lockfile(s) to hash when generating the cache key (e.g., package-lock.json, yarn.lock, etc.). It only works when cache is set. It also supports wildcards or a list of file names (for multiple lockfiles, such as in monorepos). Default is empty (''). [1]

The official docs/examples show usage like:

  • Single lockfile in a subdirectory (monorepo example): cache-dependency-path: subdir/package-lock.json [1]
  • Background/announcement of the feature (monorepo/pnpm): “Use the optional cache-dependency-path field to specify the path to dependency file(s).” [2]

Sources: [1] [2]


Add the cache parameter to enable Node.js dependency caching.

The cache-dependency-path parameter in actions/setup-node only works when cache is explicitly set. Without it, the path specification has no effect. To enable caching, add:

Proposed fix
       - name: Setup Node.js
         uses: actions/setup-node@v6
         with:
+          cache: 'npm'
           cache-dependency-path: '**/package-lock.json'
🤖 Prompt for AI Agents
In @.github/workflows/cancel-event.yml around lines 19 - 22, The
actions/setup-node@v6 step currently sets cache-dependency-path but omits the
required cache parameter, so add cache: 'npm' to that same step to enable
dependency caching (keep cache-dependency-path: '**/package-lock.json' and the
existing uses: 'actions/setup-node@v6' intact); this ensures setup-node actually
uses the package-lock.json path for caching.

- name: Install deps
run: npm install
Expand Down