1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-go synced 2025-06-15 14:54:09 +02:00

Rework cache handling

This commit is contained in:
Vladimir Safonkin 2022-06-28 14:17:12 +02:00
parent 6036aa2424
commit 0fd92001e9
4 changed files with 69 additions and 49 deletions

View file

@ -58,18 +58,11 @@ const cachePackages = async () => {
return;
}
try {
await cache.saveCache(cachePaths, primaryKey);
core.info(`Cache saved with the key: ${primaryKey}`);
} catch (error) {
if (error.name === cache.ValidationError.name) {
throw error;
} else if (error.name === cache.ReserveCacheError.name) {
core.info(error.message);
} else {
core.warning(`${error.message}`);
}
const cacheId = await cache.saveCache(cachePaths, primaryKey);
if (cacheId == -1) {
return;
}
core.info(`Cache saved with the key: ${primaryKey}`);
};
export function logWarning(message: string): void {