Skip to content

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

@andreasabel

Description

@andreasabel

cache/save/README.md

Lines 83 to 84 in 04f198b

- 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.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions