mirror of
https://github.com/actions/cache.git
synced 2026-04-06 23:06:59 +00:00
feat: Introduced restore-only flag
This commit is contained in:
parent
668228422a
commit
e58227cd44
10 changed files with 63 additions and 5 deletions
3
dist/restore-only/index.js
vendored
3
dist/restore-only/index.js
vendored
|
|
@ -46306,7 +46306,8 @@ var Inputs;
|
|||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
|
||||
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
|
||||
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
|
||||
Inputs["LookupOnly"] = "lookup-only";
|
||||
Inputs["RestoreOnly"] = "restore-only"; // Input for cache, restore action
|
||||
})(Inputs || (exports.Inputs = Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
|
|
|
|||
3
dist/restore/index.js
vendored
3
dist/restore/index.js
vendored
|
|
@ -46306,7 +46306,8 @@ var Inputs;
|
|||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
|
||||
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
|
||||
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
|
||||
Inputs["LookupOnly"] = "lookup-only";
|
||||
Inputs["RestoreOnly"] = "restore-only"; // Input for cache, restore action
|
||||
})(Inputs || (exports.Inputs = Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
|
|
|
|||
7
dist/save-only/index.js
vendored
7
dist/save-only/index.js
vendored
|
|
@ -46306,7 +46306,8 @@ var Inputs;
|
|||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
|
||||
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
|
||||
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
|
||||
Inputs["LookupOnly"] = "lookup-only";
|
||||
Inputs["RestoreOnly"] = "restore-only"; // Input for cache, restore action
|
||||
})(Inputs || (exports.Inputs = Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
|
|
@ -46401,6 +46402,10 @@ function saveImpl(stateProvider) {
|
|||
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||
return;
|
||||
}
|
||||
if (utils.getInputAsBool(constants_1.Inputs.RestoreOnly)) {
|
||||
core.info("Skipping saving cache as 'restore-only' option is set.");
|
||||
return;
|
||||
}
|
||||
// If restore has stored a primary key in state, reuse that
|
||||
// Else re-evaluate from inputs
|
||||
const primaryKey = stateProvider.getState(constants_1.State.CachePrimaryKey) ||
|
||||
|
|
|
|||
7
dist/save/index.js
vendored
7
dist/save/index.js
vendored
|
|
@ -46306,7 +46306,8 @@ var Inputs;
|
|||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
|
||||
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
|
||||
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
|
||||
Inputs["LookupOnly"] = "lookup-only";
|
||||
Inputs["RestoreOnly"] = "restore-only"; // Input for cache, restore action
|
||||
})(Inputs || (exports.Inputs = Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
|
|
@ -46401,6 +46402,10 @@ function saveImpl(stateProvider) {
|
|||
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||
return;
|
||||
}
|
||||
if (utils.getInputAsBool(constants_1.Inputs.RestoreOnly)) {
|
||||
core.info("Skipping saving cache as 'restore-only' option is set.");
|
||||
return;
|
||||
}
|
||||
// If restore has stored a primary key in state, reuse that
|
||||
// Else re-evaluate from inputs
|
||||
const primaryKey = stateProvider.getState(constants_1.State.CachePrimaryKey) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue