Closed Balvajs closed 2 years ago
The original actions/cache action is setting cache-hit to true only if the cache key was exact match:
cache-hit
true
restore-keys - An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note cache-hit returns false in this case.
So this PR fixes the behavior and sets the cache-hit output to true just only if the cache key is exact match.
Also persist key inside state, so it's not re-evaluated in post action. And change restore so it prioritizes cache matched with key over restore-keys.
key
restore
restore-keys
Hi @Balvajs , thanks very much for the contribution. All looks good. I just had to do some quick formatting. Merging after pipeline run
The original actions/cache action is setting
cache-hit
totrue
only if the cache key was exact match:So this PR fixes the behavior and sets the
cache-hit
output totrue
just only if the cache key is exact match.Also persist
key
inside state, so it's not re-evaluated in post action. And changerestore
so it prioritizes cache matched withkey
overrestore-keys
.