From 1567e6166a33d49e37fd9fe91e5244796b1bf5c6 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Tue, 14 Feb 2023 14:41:35 +0100 Subject: [PATCH] Do not abort build on restore cache error --- dist/setup/index.js | 7 ++++++- src/main.ts | 14 +++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 5bf36f5f6..ecb3dd109 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -63613,7 +63613,12 @@ function run() { if (cache && cache_utils_1.isCacheFeatureAvailable()) { const packageManager = 'default'; const cacheDependencyPath = core.getInput('cache-dependency-path'); - yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath); + try { + yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath); + } + catch (e) { + core.warning(`Restore cache failed: ${e.message}`); + } } // add problem matchers const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json'); diff --git a/src/main.ts b/src/main.ts index 6cdb2e614..2e75e0f66 100644 --- a/src/main.ts +++ b/src/main.ts @@ -62,11 +62,15 @@ export async function run() { if (cache && isCacheFeatureAvailable()) { const packageManager = 'default'; const cacheDependencyPath = core.getInput('cache-dependency-path'); - await restoreCache( - parseGoVersion(goVersion), - packageManager, - cacheDependencyPath - ); + try { + await restoreCache( + parseGoVersion(goVersion), + packageManager, + cacheDependencyPath + ); + } catch (e) { + core.warning(`Restore cache failed: ${e.message}`) + } } // add problem matchers