cache icon indicating copy to clipboard operation
cache copied to clipboard

`if: always()` with `cache/save` may lead to errors (fix README!)

Open andreasabel opened this issue 2 years ago • 5 comments

https://github.com/actions/cache/blob/04f198bf0b2a39f7230a4304bf07747a0bddf146/save/README.md?plain=1#L83-L84

In my experience, if we had an exact cache hit, the attempt to save the cache (under the same key) will produce an error. So, the docs should be updated to something like

if: always() && !steps.<cache-restore-step>.outputs.cache-hit

at least in cases where we did a restore.

As cache-hit will only be true if the cache-primary-key equals the cache-matched-key this will always save the cache when it is possible.

andreasabel avatar Apr 20 '23 09:04 andreasabel

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.

github-actions[bot] avatar Nov 07 '23 08:11 github-actions[bot]

Issue is still unfixed: https://github.com/actions/cache/blob/704facf57e6136b1bc63b828d79edcd491f0ee84/save/README.md?plain=1#L83-L84

andreasabel avatar Nov 08 '23 18:11 andreasabel

ATTN: @bethanyj28 Please triage/fix.

andreasabel avatar Nov 08 '23 18:11 andreasabel