Using the cache action for node modules

My caching action isn’t working. Here is what I want to do:

  1. restore the “./node_modules” 
  2. run yarn (or yarn install) and let it update as needed; but NOT pull everything, which takes a few minutes
  3. at end of successful job, the cache (with any updates applied by yarn) will be overwritten by new cache

So here is my action on the prior rev:

Here is the post cache action on the prior rev.

And now on the latest rev, it should have found the cache, but:

Edited – today I tried to add partial key matches… did not work. At the caching step:

Cache node moduless
Cache not found for input keys: Linux-build-cache-node-modules-107fea83967ecfbef8f1cac0a7aa6ae2379adae9403ce39a957ba8e180170a47, Linux-build-cache-node-modules-, Linux-build-, Linux-.
Run actions/cache@v1
  with:
    path: ./node_modules
    key: Linux-build-cache-node-modules-107fea83967ecfbef8f1cac0a7aa6ae2379adae9403ce39a957ba8e180170a47
    restore-keys: Linux-build-cache-node-modules-
  Linux-build-
  Linux-

  env:
    version: 1.0.5
    artifactname: book-package-app_1.0.5_amd64.deb
    assetname: book-package-app_1.0.5_amd64.deb
    cache-name: cache-node-modules
Cache not found for input keys: Linux-build-cache-node-modules-107fea83967ecfbef8f1cac0a7aa6ae2379adae9403ce39a957ba8e180170a47, Linux-build-cache-node-modules-, Linux-build-, Linux-.

What I thinking or doing wrong?

@mandolyte ,

This problem is same as that in this ticket. I also had created an issue ticket (see here) to report this problem, the appropriate engineering team is evaluating and investigating this problem. You can follow this issue ticket and add your comments here.

I noticed the appropriate engineer has provided some suggestions for troubleshooting, please check with these:

Cache’s are scoped to a key and a branch, so a cache created on  branch-A  won’t be accessible by  branch-B  unless  branch-A  is the default branch.

It’s recommended that you have a workflow run on your default branch (usually  master ) so that worklows on other branches will have a cache to restore from.