cache icon indicating copy to clipboard operation
cache copied to clipboard

Add the ability to only check for a cache key without restoring

Open bowd opened this issue 5 years ago • 1 comments

Overview

In some situations it helps to have a way to only check that a cache key exists without spending the extra time to download the cache: for example when you have a job that handles building and a separate job that handles running tests. The job that builds is a NOOP when the cache exists but it needs to verify first. If the build is pretty large that adds time spent downloading a payload that gets ignored and then downloaded again in the other job.

Fixes: #321

❗ Until this gets merged

This can be used today by referencing bowd/cache@v3 in the actions instead of actions/cache@v2 The input is only-check-key. If that is set to true it will skip the downloading but output the same cache-hit as the normal flow.

bowd avatar Sep 29 '20 15:09 bowd

Also unrelated to this CI is failing because of this: https://github.com/actions/toolkit/pull/589

bowd avatar Sep 30 '20 10:09 bowd

Hey @bowd – am relying on the only-check-key in your bowd/cache@v3 action and just noticed you closed this PR, curious if there was any particular reason? Did you find an alternative solution?

supermario avatar Dec 08 '22 10:12 supermario

If anyone else stumbles across this, https://github.com/marketplace/actions/cache now has lookup-only.

supermario avatar Mar 16 '23 20:03 supermario