Merge remote-tracking branch 'upstream/main' into feature/corepack

This commit is contained in:
Jacob Parish 2024-01-02 08:34:01 -06:00
commit c871b9da45
10 changed files with 211 additions and 193 deletions

View file

@ -1,6 +1,5 @@
import * as core from '@actions/core';
import fs from 'fs';
import os from 'os';
import * as auth from './authutil';
@ -9,7 +8,7 @@ import {restoreCache} from './cache-restore';
import {isCacheFeatureAvailable} from './cache-utils';
import {getNodejsDistribution} from './distributions/installer-factory';
import {
parseNodeVersionFile,
getNodeVersionFromFile,
printEnvDetailsAndSetOutput,
enableCorepack
} from './util';
@ -106,15 +105,7 @@ function resolveVersionInput(): string {
versionFileInput
);
if (!fs.existsSync(versionFilePath)) {
throw new Error(
`The specified node version file at: ${versionFilePath} does not exist`
);
}
const parsedVersion = parseNodeVersionFile(
fs.readFileSync(versionFilePath, 'utf8')
);
const parsedVersion = getNodeVersionFromFile(versionFilePath);
if (parsedVersion) {
version = parsedVersion;