From 6977c031ae59b16fb87b34271efc3bd5fb24b057 Mon Sep 17 00:00:00 2001 From: Kengo TODA Date: Wed, 14 Jul 2021 20:23:49 +0800 Subject: [PATCH] try to run restore after the authentication --- dist/setup/index.js | 6 ++++-- src/setup-java.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 61cf5c97..745c5560 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -59781,7 +59781,6 @@ function run() { if (!distribution) { throw new Error(`No supported distribution was found for input ${distributionName}`); } - const restoreResult = cache ? cache_1.restore(cache) : Promise.resolve(); const result = yield distribution.setupJava(); core.info(''); core.info('Java configuration:'); @@ -59791,7 +59790,10 @@ function run() { core.info(''); const matchersPath = path.join(__dirname, '..', '..', '.github'); core.info(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); - yield Promise.all([restoreResult, auth.configureAuthentication()]); + yield auth.configureAuthentication(); + if (cache) { + yield cache_1.restore(cache); + } } catch (error) { core.setFailed(error.message); diff --git a/src/setup-java.ts b/src/setup-java.ts index ea4e54e8..c6b12875 100644 --- a/src/setup-java.ts +++ b/src/setup-java.ts @@ -29,7 +29,6 @@ async function run() { throw new Error(`No supported distribution was found for input ${distributionName}`); } - const restoreResult = cache ? restore(cache) : Promise.resolve(); const result = await distribution.setupJava(); core.info(''); @@ -42,7 +41,10 @@ async function run() { const matchersPath = path.join(__dirname, '..', '..', '.github'); core.info(`##[add-matcher]${path.join(matchersPath, 'java.json')}`); - await Promise.all([restoreResult, auth.configureAuthentication()]); + await auth.configureAuthentication(); + if (cache) { + await restore(cache); + } } catch (error) { core.setFailed(error.message); }