cache
cache copied to clipboard
Wrong post caching output when storing multiple cache
When saving multiple cache
, post cache run indicates it caches using the same cache key
even when different cache keys were used. I have been able to recreate the bug in a test repo which runs a script file.sh
(only if cache doesn't restore) that creates a file and is uploaded to cache.
Running the first action with an unique key logs
that the cache stores the key twice which shouldn't be as the first key is indicated as value808119-./folder1/file_mod
and the second value808119-./folder2/file_mod
.
Running the second action which uses the unique keys specified above indicates that the two keys were correctly uploaded.
@metaclips,
I'm guessing that the cache action uses the id
to restore its state during the Post Run
. Since the code uses the same id
for both caches, I think it just uses the last one.
- id: cache_hit
@metaclips Will it be possible for you to rerun this scenario? I'll take a look. The logs you mentioned have expired.
I did get to check this by cloning the repo above. Looks like we store the key in the environment during the restore step which is reused in the save step. Thus, causing this bug. Marking as bug for now. Will see what we can do to fix this. Contribution are welcome as this will mostly require changes in actions/toolkit and actions/cache.
Possibly related to - https://github.com/actions/runner/issues/1899
This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.
Looks like this is fixed by https://github.com/actions/runner/pull/1794 . Closing for now. Feel free to reopen.