Skip to content

Commit

Permalink
Initialize cache variable closer to usage
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Oct 24, 2023
1 parent 8f152de commit 91d37fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 91d37fb

Please sign in to comment.