question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

optional action failure on cache miss

See original GitHub issue

Can 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:open
  • Created a year ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kotewarcommented, Dec 22, 2022

Hmm, I’ll change the category for now to take a better look at such asks. 😃

1reaction
deitchcommented, Oct 13, 2022

That sounds interesting. I rather am looking forward to that.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found