mirror of
https://github.com/actions/cache.git
synced 2026-07-02 13:19:31 +00:00
feat: Introduced restore-only flag
This commit is contained in:
parent
55cc834586
commit
ed7b7dd218
10 changed files with 63 additions and 5 deletions
3
dist/restore-only/index.js
vendored
3
dist/restore-only/index.js
vendored
|
|
@ -94801,7 +94801,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 || (Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
|
|
|
|||
3
dist/restore/index.js
vendored
3
dist/restore/index.js
vendored
|
|
@ -94801,7 +94801,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 || (Inputs = {}));
|
||||
var constants_Outputs;
|
||||
(function (Outputs) {
|
||||
|
|
|
|||
7
dist/save-only/index.js
vendored
7
dist/save-only/index.js
vendored
|
|
@ -94806,7 +94806,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 || (Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
|
|
@ -94937,6 +94938,10 @@ async function saveImpl(stateProvider) {
|
|||
logWarning(`Event Validation Error: The event type ${process.env[Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||
return;
|
||||
}
|
||||
if (getInputAsBool(Inputs.RestoreOnly)) {
|
||||
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(State.CachePrimaryKey) ||
|
||||
|
|
|
|||
7
dist/save/index.js
vendored
7
dist/save/index.js
vendored
|
|
@ -94806,7 +94806,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 || (Inputs = {}));
|
||||
var constants_Outputs;
|
||||
(function (Outputs) {
|
||||
|
|
@ -94937,6 +94938,10 @@ async function saveImpl(stateProvider) {
|
|||
logWarning(`Event Validation Error: The event type ${process.env[Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||
return;
|
||||
}
|
||||
if (getInputAsBool(Inputs.RestoreOnly)) {
|
||||
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_State.CachePrimaryKey) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue