GeezerVison is showing github.com — `if: always()` with `cache/save` may lead to errors (fix README!) · Issue #1154 · actions/cache
if: always() with cache/save may lead to errors (fix README!) #1154
Description
|
- uses: actions/cache/save@v3 |
|
if: always() // or any other condition to invoke the save action |
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. Reacted by Mark Vander Stel and Iman Mahmoudinasab Activitychanged the title [-]`if: always()` with `cache/save` will lead to errors (fix README!)[/-] [+]`if: always()` with `cache/save` may lead to errors (fix README!)[/+] on Apr 20, 2023github-actions commented on Nov 7, 2023 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. andreasabel commented on Nov 8, 2023 Issue is still unfixed:
|
- uses: actions/cache/save@v3 |
|
if: always() // or any other condition to invoke the save action |
andreasabel commented on Nov 8, 2023 github-actions commented on May 27, 2024 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. andreasabel commented on May 27, 2024 Rather
if: always() && steps.<cache-restore-step>.outputs.cache-hit != 'true'
joshmgross commented on Aug 14, 2024 andreasabel commented on Aug 15, 2024 Finally!
Maybe fixing this one line shouldn't have taken 16 months, meanwhile leading thousands of users astray... Reacted by Uzair Aftab, Joanna, Andrea Bedini and Luca Zanzottera joshmgross commented on Oct 7, 2024
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|