Debug-action-cache -

System paths, language runtimes, or flags (e.g., PATH , JAVA_HOME ).

Always append a cryptographic hash of your lockfiles to the cache key structure. For example, use $ runner.os -node-$ hashFiles('**/package-lock.json') . This guarantees that any change to your dependency tree automatically invalidates the old cache.

Prevent untrusted or experimental PR code from overwriting the main branch's cache. Only allow the default branch ( main / master ) to write to the cache. debug-action-cache

Once enabled, your build logs will display the exact paths being zipped, the network requests sent to the cache server, and the exact keys being searched. 2. Inspect the Cache Keys and Paths

Every run tries to cache node_modules but fails due to >2 GB size. Debugging: Debug log explicitly says cache size (2.8 GB) exceeds limit . Fix: Cache only production dependencies ( npm ci --production ) or split across multiple cache actions. System paths, language runtimes, or flags (e

A common root cause of cache failure is path mismatching. If the action saves ~/.npm but your build tool is actually placing cache files in ./node_modules/.cache , the action will back up an empty or irrelevant directory.

Use @actions/cache package in a small Node script: This guarantees that any change to your dependency

A previous broken build successfully saved its incomplete or broken dependencies into the cache storage, causing all future runs to pull corrupted files.

Standard logs just show Received 0 of 0 artifacts . That is useless. To see the truth, you need , specifically for the cache action.