mirror of
https://github.com/actions/cache.git
synced 2025-07-16 12:05:33 -06:00
Allow for multiple line-delimited paths to cache
This commit is contained in:
parent
826785142a
commit
84cead4a82
8 changed files with 116 additions and 58 deletions
14
src/save.ts
14
src/save.ts
|
@ -43,10 +43,14 @@ async function run(): Promise<void> {
|
|||
return;
|
||||
}
|
||||
core.debug(`Cache ID: ${cacheId}`);
|
||||
const cachePath = utils.resolvePath(
|
||||
core.getInput(Inputs.Path, { required: true })
|
||||
);
|
||||
core.debug(`Cache Path: ${cachePath}`);
|
||||
const cachePaths = core
|
||||
.getInput(Inputs.Path)
|
||||
.split("\n")
|
||||
.filter(x => x !== "")
|
||||
.map(x => utils.resolvePath(x));
|
||||
|
||||
core.debug("Cache Paths:");
|
||||
core.debug(`${JSON.stringify(cachePaths)}`);
|
||||
|
||||
const archivePath = path.join(
|
||||
await utils.createTempDirectory(),
|
||||
|
@ -54,7 +58,7 @@ async function run(): Promise<void> {
|
|||
);
|
||||
core.debug(`Archive Path: ${archivePath}`);
|
||||
|
||||
await createTar(archivePath, cachePath);
|
||||
await createTar(archivePath, cachePaths);
|
||||
|
||||
const fileSizeLimit = 5 * 1024 * 1024 * 1024; // 5GB per repo limit
|
||||
const archiveFileSize = utils.getArchiveFileSize(archivePath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue