Deprecate save-always input (#1452)

The `save-always` input added in v4 is not
working as intended due to
`post-if` expressions not supporting the input
context.
To avoid breaking users who have already added
this input to their workflows, it is being
deprecated now and will be removed
in the next major version (v5).
See https://github.com/actions/cache/issues/1315 for more details.
This commit is contained in:
Josh Gross 2024-10-03 14:37:55 -04:00 committed by GitHub
parent f8a7ab490b
commit c74ca4022c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 46 additions and 34 deletions

View file

@ -29,7 +29,11 @@ inputs:
save-always:
description: 'Run the post step to save the cache even if another step before fails'
default: 'false'
required: false
required: false
deprecationMessage: |
save-always does not work as intended and will be removed in a future release.
A separate `actions/cache/restore` step should be used instead.
See https://github.com/actions/cache/tree/main/save#always-save-cache for more details.
outputs:
cache-hit:
description: 'A boolean value to indicate an exact match was found for the primary key'
@ -37,7 +41,7 @@ runs:
using: 'node20'
main: 'dist/restore/index.js'
post: 'dist/save/index.js'
post-if: "success() || github.event.inputs.save-always"
post-if: "success()"
branding:
icon: 'archive'
color: 'gray-dark'