From 7d0203234ef0f02941947d53ce3b7010a9af713d Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Tue, 24 Oct 2023 10:48:34 -0700 Subject: [PATCH 1/2] Initialize cache variable closer to usage --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index ac051766..28f0a495 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,7 +20,6 @@ export async function run() { const version = resolveVersionInput(); let arch = core.getInput('architecture'); - const cache = core.getInput('cache'); // if architecture supplied but node-version is not // if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant. @@ -60,6 +59,7 @@ export async function run() { auth.configAuthentication(registryUrl, alwaysAuth); } + const cache = core.getInput('cache'); if (cache && isCacheFeatureAvailable()) { core.saveState(State.CachePackageManager, cache); const cacheDependencyPath = core.getInput('cache-dependency-path'); From 325751ad7dc8f907fdb7882cbe84f0cf216f0dca Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sat, 11 Nov 2023 06:57:39 +0000 Subject: [PATCH 2/2] chore: npm run format --- dist/setup/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 0512f3a7..9d9fd436 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -93668,7 +93668,6 @@ function run() { // const version = resolveVersionInput(); let arch = core.getInput('architecture'); - const cache = core.getInput('cache'); // if architecture supplied but node-version is not // if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant. if (arch && !version) { @@ -93698,6 +93697,7 @@ function run() { if (registryUrl) { auth.configAuthentication(registryUrl, alwaysAuth); } + const cache = core.getInput('cache'); if (cache && (0, cache_utils_1.isCacheFeatureAvailable)()) { core.saveState(constants_1.State.CachePackageManager, cache); const cacheDependencyPath = core.getInput('cache-dependency-path');