mirror of
https://github.com/actions/cache.git
synced 2025-04-22 03:56:45 +00:00
Add option to re-evaluate cache key during post action
This commit is contained in:
parent
5a3ec84eff
commit
f0a29e5cc9
4 changed files with 10 additions and 4 deletions
|
@ -5,7 +5,8 @@ export enum Inputs {
|
|||
UploadChunkSize = "upload-chunk-size", // Input for cache, save action
|
||||
EnableCrossOsArchive = "enableCrossOsArchive", // Input for cache, restore, save action
|
||||
FailOnCacheMiss = "fail-on-cache-miss", // Input for cache, restore action
|
||||
LookupOnly = "lookup-only" // Input for cache, restore action
|
||||
LookupOnly = "lookup-only", // Input for cache, restore action
|
||||
ReEvalKey = "reeval-key"
|
||||
}
|
||||
|
||||
export enum Outputs {
|
||||
|
|
|
@ -34,9 +34,9 @@ export async function saveImpl(
|
|||
|
||||
// If restore has stored a primary key in state, reuse that
|
||||
// Else re-evaluate from inputs
|
||||
const primaryKey =
|
||||
stateProvider.getState(State.CachePrimaryKey) ||
|
||||
core.getInput(Inputs.Key);
|
||||
const primaryKey = core.getBooleanInput(Inputs.ReEvalKey)
|
||||
? core.getInput(Inputs.Key)
|
||||
: (stateProvider.getState(State.CachePrimaryKey) || core.getInput(Inputs.Key));
|
||||
|
||||
if (!primaryKey) {
|
||||
utils.logWarning(`Key is not specified.`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue