optional action failure on cache miss
See original GitHub issueCan we have an option to fail on cache miss? The current behaviour is:
- cache hit: restore, exit successfully
- cache miss: do not restore, exit successfully
Much of the time, the above makes sense. But there can be workflows where you might want to fail if cache miss. For example, 2 jobs that depend on each other and use cache to move ephemeral artifacts around. We don’t want them as formal artifacts, but a cache miss should cause the job to stop.
Right now, you can do it with a little convolution:
- name: update from cache
id: cache
uses: actions/cache@v3
with:
path: foo
key: some-key
- name: Fail if cache miss
uses: actions/github-script@v6
if: steps.cache.outputs.cache-hit != 'true'
with:
script: core.setFailed('Cache hit failed')
That gets unwieldy, especially if it has to be done in a few jobs. The following would be much easier:
- name: update from cache
id: cache
uses: actions/cache@v3
with:
path: foo
key: some-key
fail_on_miss: true # this, or some similar key
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to Fix 'ERR_CACHE_MISS' in Chrome (7 Methods) - Kinsta
Clear Your Browser Data. If your browser has accumulated corrupted files in your cache, it may result in the error message you're seeing...
Read more >Intermittent HTTP cache GET/PUT silent failures. #487 - GitHub
I'm seeing intermittent cache misses that I believe to be caused by a failure to PUT/GET a given cache key to/from Vercel.
Read more >Debugging and diagnosing cache misses - Gradle User Manual
Helpful data for diagnosing a cache miss A cache miss happens when Gradle calculates a build cache key for a task which is...
Read more >Cache Miss – What It Is and How to Reduce It - Hostinger
Cache miss suggests that requested data is not available in cache memory. Read on to learn how to reduce them and make the...
Read more >Clear cache in GitHub Actions - Stack Overflow
In order to do so, you have to change the cache key (and any restore-keys ). Because if the key(s) is/are different, this...
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
Hmm, I’ll change the category for now to take a better look at such asks. 😃
That sounds interesting. I rather am looking forward to that.