Consuming 3.0 actions/cache

This commit is contained in:
Shubham Tiwari authored and GitHub committed 2022-06-24 04:06:33 +00:00
1 parent a0efc56c52
commit c75dca6de7
7 files changed
+127 -119

No files matched your search

+7 -14
View File
@@ -44,21 +44,14 @@ async function run(): Promise<void> {
required: true
});
try {
await cache.saveCache(cachePaths, primaryKey, {
uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
});
core.info(`Cache saved with key: ${primaryKey}`);
} catch (error: unknown) {
const typedError = error as Error;
if (typedError.name === cache.ValidationError.name) {
throw error;
} else if (typedError.name === cache.ReserveCacheError.name) {
core.info(typedError.message);
} else {
utils.logWarning(typedError.message);
}
const cacheId = await cache.saveCache(cachePaths, primaryKey, {
uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
});
if (cacheId == -1 ) {
return;
}
core.info(`Cache saved with key: ${primaryKey}`);
} catch (error: unknown) {
utils.logWarning((error as Error).message);
}