Pass additional restore-keys to cache action
See original GitHub issueAs can be seen in their examples: https://github.com/actions/cache/blob/main/examples.md#java---gradle
It is recommended that additional restore-keys are passed when using actions/cache
. https://github.com/actions/cache#inputs
https://github.com/actions/setup-java/blob/5b36705a13905facb447b6812d613a06a07e371d/src/cache.ts#L100 could be changed to something like:
const restoreKey = `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${packageManager.id}`;
const matchedKey = await cache.restoreCache(packageManager.path, primaryKey, [restoreKey]);
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Caching dependencies to speed up workflows - GitHub Docs
You can create multiple restore keys ordered from the most specific to least specific. The cache action searches the restore-keys in sequential order....
Read more >How do I cache steps in GitHub actions? - Stack Overflow
It is useful to prefix keys and restore keys with the OS and name of the cache, as it shouldn't load files for...
Read more >How to cache node_modules in GitHub Actions with Yarn
I just want to add a little note to this. According to the cache action docs, caching node_modules is not recommended.
Read more >Working with file caching - Amazon CodeCatalyst
Cache key names must be unique within your workflow. Each action can have up to five entries in FileCaching . Path. Specify the...
Read more >Caching Dependencies on GitHub Workflows - Rupesh Tiwari
When a cache miss occurs, the action searches for alternate keys called restore-keys . Creating Workflow with Cache ActionPermalink. Let's ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The feature request is declined because the requested functionality exist in the other action https://github.com/actions/cache
Built-in cache is not intended to be flexible, it is intended to work out of box in the most cases. For the specific complex caching that requires flexibility and customisation there’s https://github.com/actions/cache action