mirror of
https://github.com/actions/cache.git
synced 2026-03-07 08:51:47 +08:00
Compare commits
3 Commits
f53083e499
...
858526aac6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
858526aac6 | ||
|
|
cccc18b26a | ||
|
|
2935c2ea27 |
@ -36,6 +36,7 @@ If you are using this inside a container, a POSIX-compliant `tar` needs to be in
|
|||||||
* `key` - An explicit key for restoring and saving the cache
|
* `key` - An explicit key for restoring and saving the cache
|
||||||
* `restore-keys` - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key. Note
|
* `restore-keys` - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key. Note
|
||||||
`cache-hit` returns false in this case.
|
`cache-hit` returns false in this case.
|
||||||
|
* `reeval-key` - A boolean which causes the key to be re-evaluated during the Post-Action step
|
||||||
|
|
||||||
#### Environment Variables
|
#### Environment Variables
|
||||||
* `SEGMENT_DOWNLOAD_TIMEOUT_MINS` - Segment download timeout (in minutes, default `60`) to abort download of the segment if not completed in the defined number of minutes. [Read more](#cache-segment-restore-timeout)
|
* `SEGMENT_DOWNLOAD_TIMEOUT_MINS` - Segment download timeout (in minutes, default `60`) to abort download of the segment if not completed in the defined number of minutes. [Read more](#cache-segment-restore-timeout)
|
||||||
|
|||||||
@ -14,6 +14,10 @@ inputs:
|
|||||||
upload-chunk-size:
|
upload-chunk-size:
|
||||||
description: 'The chunk size used to split up large files during upload, in bytes'
|
description: 'The chunk size used to split up large files during upload, in bytes'
|
||||||
required: false
|
required: false
|
||||||
|
reeval-key:
|
||||||
|
description: 'Re-evaluate the cache key during the post-action'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit:
|
cache-hit:
|
||||||
description: 'A boolean value to indicate an exact match was found for the primary key'
|
description: 'A boolean value to indicate an exact match was found for the primary key'
|
||||||
|
|||||||
1
dist/restore/index.js
vendored
1
dist/restore/index.js
vendored
@ -4947,6 +4947,7 @@ var Inputs;
|
|||||||
Inputs["Path"] = "path";
|
Inputs["Path"] = "path";
|
||||||
Inputs["RestoreKeys"] = "restore-keys";
|
Inputs["RestoreKeys"] = "restore-keys";
|
||||||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||||
|
Inputs["ReEvalKey"] = "reeval-key";
|
||||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
||||||
var Outputs;
|
var Outputs;
|
||||||
(function (Outputs) {
|
(function (Outputs) {
|
||||||
|
|||||||
6
dist/save/index.js
vendored
6
dist/save/index.js
vendored
@ -4947,6 +4947,7 @@ var Inputs;
|
|||||||
Inputs["Path"] = "path";
|
Inputs["Path"] = "path";
|
||||||
Inputs["RestoreKeys"] = "restore-keys";
|
Inputs["RestoreKeys"] = "restore-keys";
|
||||||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||||
|
Inputs["ReEvalKey"] = "reeval-key";
|
||||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
||||||
var Outputs;
|
var Outputs;
|
||||||
(function (Outputs) {
|
(function (Outputs) {
|
||||||
@ -47297,8 +47298,9 @@ function run() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const state = utils.getCacheState();
|
const state = utils.getCacheState();
|
||||||
// Inputs are re-evaluted before the post action, so we want the original key used for restore
|
const primaryKey = core.getBooleanInput(constants_1.Inputs.ReEvalKey)
|
||||||
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
|
? core.getInput(constants_1.Inputs.Key, { required: true })
|
||||||
|
: core.getState(constants_1.State.CachePrimaryKey);
|
||||||
if (!primaryKey) {
|
if (!primaryKey) {
|
||||||
utils.logWarning(`Error retrieving key from state.`);
|
utils.logWarning(`Error retrieving key from state.`);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -2,7 +2,8 @@ export enum Inputs {
|
|||||||
Key = "key",
|
Key = "key",
|
||||||
Path = "path",
|
Path = "path",
|
||||||
RestoreKeys = "restore-keys",
|
RestoreKeys = "restore-keys",
|
||||||
UploadChunkSize = "upload-chunk-size"
|
UploadChunkSize = "upload-chunk-size",
|
||||||
|
ReEvalKey = "reeval-key"
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum Outputs {
|
export enum Outputs {
|
||||||
|
|||||||
@ -26,8 +26,9 @@ async function run(): Promise<void> {
|
|||||||
|
|
||||||
const state = utils.getCacheState();
|
const state = utils.getCacheState();
|
||||||
|
|
||||||
// Inputs are re-evaluted before the post action, so we want the original key used for restore
|
const primaryKey = core.getBooleanInput(Inputs.ReEvalKey)
|
||||||
const primaryKey = core.getState(State.CachePrimaryKey);
|
? core.getInput(Inputs.Key, { required: true })
|
||||||
|
: core.getState(State.CachePrimaryKey);
|
||||||
if (!primaryKey) {
|
if (!primaryKey) {
|
||||||
utils.logWarning(`Error retrieving key from state.`);
|
utils.logWarning(`Error retrieving key from state.`);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user