Closed jromero-pg closed 1 year ago
Hi @jromero-pg , this all make sense. Are you willing to submit a quick fix for this? Feels pretty straight forward?
Unfortunately, we only stumbled upon migrating across different runners, and I've been heads down trying to make that happen.
I agree that it's pretty straightforward. Maybe it's worth adding a good-first-issue
label? :)
@jromero-pg I remember encountering this during the initial dev. I resolved it by using utils.getCompressionMethod();
from "@actions/cache/lib/internal/cacheUtils"; see https://github.com/tespkg/actions-cache/blob/main/src/save.ts#L38
If it only happens during runner migration, I don't think we should pay special attention to it: It should to restore cache and save a new one.
I'll close this one, but feel free to re-open if this is not the case
We ran into this exact issue. The problem is that the new cache is never saved: Cache was exact key match, not saving
Describe the bug
We use similar steps (and there by caching logic) across multiple jobs that run on different runners. There's an issue with the current version of
@actions/cache
this action is using that fails to detect zstd properly. The side effect from that bug is that cache is packages using zstd but later downloaded with an attempt to unpackage is using tar (gzipped).Looking at the code base, this is due to
findObject
using thekey
without includingcacheFilename
. Whereas save creates the object usingkey
+cacheFilename
. This effectively makesrestore
a partial match instead of an exact match.To Reproduce
some-file/cache.invalid-ext
Create a workflow:
Notice that
some-file/cache.invalid-ext
is downloaded.Expected behavior
some-file/cache.invalid-ext
should not match.Screenshots
Code/Script reproduction
Additional context