mirror of
https://github.com/actions/cache.git
synced 2025-06-18 23:02:57 -06:00
Release v1.0.1
This commit is contained in:
parent
9d8c7b4041
commit
0f810ad45a
6 changed files with 91 additions and 83 deletions
|
@ -20,7 +20,10 @@ async function run() {
|
|||
const primaryKey = core.getInput(Inputs.Key, { required: true });
|
||||
core.saveState(State.CacheKey, primaryKey);
|
||||
|
||||
const restoreKeys = core.getInput(Inputs.RestoreKeys).split("\n");
|
||||
const restoreKeys = core
|
||||
.getInput(Inputs.RestoreKeys)
|
||||
.split("\n")
|
||||
.filter(x => x !== "");
|
||||
const keys = [primaryKey, ...restoreKeys];
|
||||
|
||||
core.debug("Resolved Keys:");
|
||||
|
@ -52,7 +55,7 @@ async function run() {
|
|||
const cacheEntry = await cacheHttpClient.getCacheEntry(keys);
|
||||
if (!cacheEntry) {
|
||||
core.info(
|
||||
`Cache not found for input keys: ${JSON.stringify(keys)}.`
|
||||
`Cache not found for input keys: ${keys.join(", ")}.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -54,12 +54,12 @@ async function run() {
|
|||
core.debug(`Tar Path: ${tarPath}`);
|
||||
await exec(`"${tarPath}"`, args);
|
||||
|
||||
const fileSizeLimit = 200 * 1024 * 1024; // 200MB
|
||||
const fileSizeLimit = 400 * 1024 * 1024; // 400MB
|
||||
const archiveFileSize = fs.statSync(archivePath).size;
|
||||
core.debug(`File Size: ${archiveFileSize}`);
|
||||
if (archiveFileSize > fileSizeLimit) {
|
||||
core.warning(
|
||||
`Cache size of ${archiveFileSize} bytes is over the 200MB limit, not saving cache.`
|
||||
`Cache size of ${archiveFileSize} bytes is over the 400MB limit, not saving cache.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue