mirror of
https://github.com/actions/cache.git
synced 2025-04-22 03:56:45 +00:00
Consuming 3.0 actions/cache (#834)
* Consuming 3.0 actions/cache * formatting and error * updated package version * resolve package * dist * review comment * dist * dist
This commit is contained in:
parent
baed3516c3
commit
354a2ae15e
9 changed files with 124 additions and 152 deletions
18
src/save.ts
18
src/save.ts
|
@ -44,20 +44,12 @@ async function run(): Promise<void> {
|
|||
required: true
|
||||
});
|
||||
|
||||
try {
|
||||
await cache.saveCache(cachePaths, primaryKey, {
|
||||
uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
|
||||
});
|
||||
const cacheId = await cache.saveCache(cachePaths, primaryKey, {
|
||||
uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
|
||||
});
|
||||
|
||||
if (cacheId != -1) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
utils.logWarning((error as Error).message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue