@@ -62346,6 +62346,7 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
62346
62346
let manifest;
62347
62347
let osPlat = os.platform();
62348
62348
let osArch = translateArchToDistUrl(arch);
62349
+ let latestVersionResolved = false;
62349
62350
if (isLtsAlias(versionSpec)) {
62350
62351
core.info('Attempt to resolve LTS alias from manifest...');
62351
62352
// No try-catch since it's not possible to resolve LTS alias without manifest
@@ -62365,6 +62366,7 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
62365
62366
}
62366
62367
if (isLatestSyntax(versionSpec)) {
62367
62368
versionSpec = yield queryDistForMatch(versionSpec, arch);
62369
+ latestVersionResolved = true;
62368
62370
core.info(`getting latest node version...`);
62369
62371
}
62370
62372
// check cache
@@ -62407,7 +62409,7 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
62407
62409
// Download from nodejs.org
62408
62410
//
62409
62411
if (!downloadPath) {
62410
- info = yield getInfoFromDist(versionSpec, arch);
62412
+ info = yield getInfoFromDist(versionSpec, arch, latestVersionResolved );
62411
62413
if (!info) {
62412
62414
throw new Error(`Unable to find Node version '${versionSpec}' for platform ${osPlat} and architecture ${osArch}.`);
62413
62415
}
@@ -62507,12 +62509,13 @@ function getInfoFromManifest(versionSpec, stable, auth, osArch = translateArchTo
62507
62509
return info;
62508
62510
});
62509
62511
}
62510
- function getInfoFromDist(versionSpec, arch = os.arch()) {
62512
+ function getInfoFromDist(versionSpec, arch = os.arch(), latestVersionResolved ) {
62511
62513
return __awaiter(this, void 0, void 0, function* () {
62512
62514
let osPlat = os.platform();
62513
62515
let osArch = translateArchToDistUrl(arch);
62514
- let version;
62515
- version = yield queryDistForMatch(versionSpec, arch);
62516
+ let version = latestVersionResolved
62517
+ ? versionSpec
62518
+ : yield queryDistForMatch(versionSpec, arch);
62516
62519
if (!version) {
62517
62520
return null;
62518
62521
}
0 commit comments