mirror of
https://github.com/actions/setup-node.git
synced 2025-04-22 09:21:00 +00:00
testing: add possible fixes
This commit is contained in:
parent
ab789e9b5b
commit
20838dd977
2 changed files with 8 additions and 8 deletions
8
dist/setup/index.js
vendored
8
dist/setup/index.js
vendored
|
@ -73208,11 +73208,11 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
|
|||
versionSpec = yield queryDistForMatch(versionSpec, arch, nodeVersions);
|
||||
core.info(`getting latest node version...`);
|
||||
}
|
||||
if (isNightly) {
|
||||
if (isNightly && checkLatest) {
|
||||
nodeVersions = yield getVersionsFromDist(versionSpec);
|
||||
versionSpec = yield queryDistForMatch(versionSpec, arch, nodeVersions);
|
||||
}
|
||||
if (checkLatest) {
|
||||
if (checkLatest && !isNightly) {
|
||||
core.info('Attempt to resolve the latest version from manifest...');
|
||||
const resolvedVersion = yield resolveVersionFromManifest(versionSpec, stable, auth, osArch, manifest);
|
||||
if (resolvedVersion) {
|
||||
|
@ -73416,7 +73416,7 @@ function evaluateVersions(versions, versionSpec) {
|
|||
core.debug(`evaluating ${versions.length} versions`);
|
||||
core.debug(`version 1 is ${versions[0]}`);
|
||||
core.debug(`version spec is ${versionSpec}`);
|
||||
versions = versions.map(item => item.replace('nightly', 'nightly.')).sort((a, b) => {
|
||||
versions = versions.map(item => item.replace('-nightly', '+nightly.')).sort((a, b) => {
|
||||
if (semver.gt(a, b)) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -73424,7 +73424,7 @@ function evaluateVersions(versions, versionSpec) {
|
|||
});
|
||||
for (let i = versions.length - 1; i >= 0; i--) {
|
||||
const potential = versions[i];
|
||||
const satisfied = semver.satisfies(potential, versionSpec);
|
||||
const satisfied = semver.satisfies(potential, versionSpec.replace('-', '+'));
|
||||
if (satisfied) {
|
||||
version = potential;
|
||||
break;
|
||||
|
|
|
@ -58,12 +58,12 @@ export async function getNode(
|
|||
core.info(`getting latest node version...`);
|
||||
}
|
||||
|
||||
if (isNightly) {
|
||||
if (isNightly && checkLatest) {
|
||||
nodeVersions = await getVersionsFromDist(versionSpec);
|
||||
versionSpec = await queryDistForMatch(versionSpec, arch, nodeVersions);
|
||||
}
|
||||
|
||||
if (checkLatest) {
|
||||
if (checkLatest && !isNightly) {
|
||||
core.info('Attempt to resolve the latest version from manifest...');
|
||||
const resolvedVersion = await resolveVersionFromManifest(
|
||||
versionSpec,
|
||||
|
@ -353,7 +353,7 @@ function evaluateVersions(versions: string[], versionSpec: string): string {
|
|||
core.debug(`evaluating ${versions.length} versions`);
|
||||
core.debug(`version 1 is ${versions[0]}`);
|
||||
core.debug(`version spec is ${versionSpec}`);
|
||||
versions = versions.map(item => item.replace('nightly', 'nightly.')).sort((a, b) => {
|
||||
versions = versions.map(item => item.replace('-nightly', '+nightly.')).sort((a, b) => {
|
||||
if (semver.gt(a, b)) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ function evaluateVersions(versions: string[], versionSpec: string): string {
|
|||
});
|
||||
for (let i = versions.length - 1; i >= 0; i--) {
|
||||
const potential: string = versions[i];
|
||||
const satisfied: boolean = semver.satisfies(potential, versionSpec);
|
||||
const satisfied: boolean = semver.satisfies(potential, versionSpec.replace('-', '+'));
|
||||
if (satisfied) {
|
||||
version = potential;
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue