mirror of
https://github.com/actions/setup-node.git
synced 2026-11-20 11:53:15 +00:00
Compare commits
1 Commits
main
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70f2d1c016 |
5
.github/workflows/versions.yml
vendored
5
.github/workflows/versions.yml
vendored
@@ -270,10 +270,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Get node version
|
- name: Get node version
|
||||||
run: |
|
run: |
|
||||||
latestNodeVersion=$(
|
latestNodeVersion=$(curl https://nodejs.org/dist/index.json | jq -r '. [0].version')
|
||||||
curl -fsSL https://nodejs.org/dist/index.json |
|
|
||||||
jq -r 'first(.[] | select(.version | test("-") | not) | .version)'
|
|
||||||
)
|
|
||||||
echo "LATEST_NODE_VERSION=$latestNodeVersion" >> $GITHUB_OUTPUT
|
echo "LATEST_NODE_VERSION=$latestNodeVersion" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -151,10 +151,9 @@ Examples:
|
|||||||
|
|
||||||
**Note:** Like the other values, `*` will get the latest [locally-cached Node.js version](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#nodejs), or the latest version from [actions/node-versions](https://github.com/actions/node-versions/blob/main/versions-manifest.json), depending on the [`check-latest`](docs/advanced-usage.md#check-latest-version) input.
|
**Note:** Like the other values, `*` will get the latest [locally-cached Node.js version](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#nodejs), or the latest version from [actions/node-versions](https://github.com/actions/node-versions/blob/main/versions-manifest.json), depending on the [`check-latest`](docs/advanced-usage.md#check-latest-version) input.
|
||||||
|
|
||||||
`current`/`latest`/`node` always resolve to the latest stable version from [dist index](https://nodejs.org/dist/index.json) (prerelease entries are skipped).
|
`current`/`latest`/`node` always resolve to the latest [dist version](https://nodejs.org/dist/index.json).
|
||||||
That version is then downloaded from actions/node-versions if possible, or directly from Node.js if not.
|
That version is then downloaded from actions/node-versions if possible, or directly from Node.js if not.
|
||||||
If no stable version is available in the dist index, setup fails with an explicit error.
|
Since it will not be cached always, there is possibility of hitting rate limit when downloading from dist
|
||||||
Since it will not always be cached, there is a possibility of hitting rate limits when downloading from dist.
|
|
||||||
|
|
||||||
### Checking in lockfiles
|
### Checking in lockfiles
|
||||||
|
|
||||||
|
|||||||
@@ -993,111 +993,6 @@ describe('setup-node', () => {
|
|||||||
expect(logSpy).toHaveBeenCalledWith('getting latest node version...');
|
expect(logSpy).toHaveBeenCalledWith('getting latest node version...');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
it.each(['latest', 'current', 'node'])(
|
|
||||||
'skips a newer prerelease and selects the latest stable version for %s',
|
|
||||||
async inputVersion => {
|
|
||||||
// Arrange
|
|
||||||
inputs['node-version'] = inputVersion;
|
|
||||||
const stableVersion = nodeTestDist[0];
|
|
||||||
const prereleaseVersion = {
|
|
||||||
...nodeTestDist[0],
|
|
||||||
version: 'v99.0.0-alpha.1'
|
|
||||||
};
|
|
||||||
|
|
||||||
os.platform = 'darwin';
|
|
||||||
os.arch = 'x64';
|
|
||||||
|
|
||||||
const cleanStableVersion = stableVersion.version.replace(/^v/, '');
|
|
||||||
const toolPath = path.normalize(
|
|
||||||
`/cache/node/${cleanStableVersion}/x64`
|
|
||||||
);
|
|
||||||
|
|
||||||
findSpy.mockImplementation(() => '');
|
|
||||||
getManifestSpy.mockImplementation(() => {
|
|
||||||
throw new Error('Unable to download manifest');
|
|
||||||
});
|
|
||||||
getJsonSpy.mockImplementation((url: any) => {
|
|
||||||
if (url === nodeVersionsManifestUrl) {
|
|
||||||
throw new Error('Unable to download raw manifest');
|
|
||||||
}
|
|
||||||
|
|
||||||
return {result: [prereleaseVersion, ...nodeTestDist]};
|
|
||||||
});
|
|
||||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
|
||||||
exSpy.mockImplementation(async () => '/some/other/temp/path');
|
|
||||||
cacheSpy.mockImplementation(async () => toolPath);
|
|
||||||
getExecOutputSpy.mockImplementation(async () => ({
|
|
||||||
stdout: `v${cleanStableVersion}\n`,
|
|
||||||
stderr: '',
|
|
||||||
exitCode: 0
|
|
||||||
}));
|
|
||||||
|
|
||||||
// Act
|
|
||||||
await runWithRetries();
|
|
||||||
|
|
||||||
// assert
|
|
||||||
expect(findSpy).toHaveBeenCalledWith(
|
|
||||||
'node',
|
|
||||||
stableVersion.version,
|
|
||||||
'x64'
|
|
||||||
);
|
|
||||||
expect(findSpy).not.toHaveBeenCalledWith(
|
|
||||||
'node',
|
|
||||||
prereleaseVersion.version,
|
|
||||||
'x64'
|
|
||||||
);
|
|
||||||
expect(dlSpy).toHaveBeenCalledWith(
|
|
||||||
`https://nodejs.org/dist/v${cleanStableVersion}/node-v${cleanStableVersion}-darwin-x64.tar.gz`,
|
|
||||||
undefined,
|
|
||||||
undefined
|
|
||||||
);
|
|
||||||
expect(setFailedSpy).not.toHaveBeenCalled();
|
|
||||||
expect(addPathSpy).toHaveBeenCalledWith(path.join(toolPath, 'bin'));
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const prereleaseOnlyIndex = [
|
|
||||||
{...nodeTestDist[0], version: 'v99.0.0-alpha.1'}
|
|
||||||
];
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['latest', 'an empty index', []],
|
|
||||||
['current', 'an empty index', []],
|
|
||||||
['node', 'an empty index', []],
|
|
||||||
['latest', 'a prerelease-only index', prereleaseOnlyIndex],
|
|
||||||
['current', 'a prerelease-only index', prereleaseOnlyIndex],
|
|
||||||
['node', 'a prerelease-only index', prereleaseOnlyIndex]
|
|
||||||
])(
|
|
||||||
'fails with the stable-version error for %s with %s',
|
|
||||||
async (inputVersion, _description, index) => {
|
|
||||||
// Arrange
|
|
||||||
inputs['node-version'] = inputVersion;
|
|
||||||
|
|
||||||
os.platform = 'darwin';
|
|
||||||
os.arch = 'x64';
|
|
||||||
|
|
||||||
findSpy.mockImplementation(() => '');
|
|
||||||
getManifestSpy.mockImplementation(() => {
|
|
||||||
throw new Error('Unable to download manifest');
|
|
||||||
});
|
|
||||||
getJsonSpy.mockImplementation((url: any) => {
|
|
||||||
if (url === nodeVersionsManifestUrl) {
|
|
||||||
throw new Error('Unable to download raw manifest');
|
|
||||||
}
|
|
||||||
|
|
||||||
return {result: index};
|
|
||||||
});
|
|
||||||
|
|
||||||
// Act
|
|
||||||
await runWithRetries();
|
|
||||||
|
|
||||||
// assert
|
|
||||||
expect(setFailedSpy).toHaveBeenCalledWith(
|
|
||||||
`Unable to find a stable Node version for '${inputVersion}' on platform ${os.platform} and architecture ${os.arch}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('latest alias syntax from cache', () => {
|
describe('latest alias syntax from cache', () => {
|
||||||
@@ -1122,11 +1017,6 @@ describe('setup-node', () => {
|
|||||||
// assert
|
// assert
|
||||||
|
|
||||||
expect(logSpy).toHaveBeenCalledWith('getting latest node version...');
|
expect(logSpy).toHaveBeenCalledWith('getting latest node version...');
|
||||||
expect(findSpy).toHaveBeenCalledWith(
|
|
||||||
'node',
|
|
||||||
expectedVersion.version,
|
|
||||||
'x64'
|
|
||||||
);
|
|
||||||
expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`);
|
expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
7
dist/setup/index.js
vendored
7
dist/setup/index.js
vendored
@@ -98991,7 +98991,6 @@ var external_node_path_default = /*#__PURE__*/__nccwpck_require__.n(external_nod
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const nodeVersionsManifestUrl = 'https://raw.githubusercontent.com/actions/node-versions/main/versions-manifest.json';
|
const nodeVersionsManifestUrl = 'https://raw.githubusercontent.com/actions/node-versions/main/versions-manifest.json';
|
||||||
const invalidManifestMessage = 'The manifest fetched is empty, truncated, or does not contain any valid tool release entries.';
|
const invalidManifestMessage = 'The manifest fetched is empty, truncated, or does not contain any valid tool release entries.';
|
||||||
function isValidManifest(manifest) {
|
function isValidManifest(manifest) {
|
||||||
@@ -99115,11 +99114,7 @@ class OfficialBuilds extends BaseDistribution {
|
|||||||
let version = '';
|
let version = '';
|
||||||
if (this.isLatestSyntax(this.nodeInfo.versionSpec)) {
|
if (this.isLatestSyntax(this.nodeInfo.versionSpec)) {
|
||||||
core_info(`getting latest node version...`);
|
core_info(`getting latest node version...`);
|
||||||
const stableVersion = versions.find(potential => semver_default().prerelease(potential) === null);
|
return versions[0];
|
||||||
if (!stableVersion) {
|
|
||||||
throw new Error(`Unable to find a stable Node version for '${this.nodeInfo.versionSpec}' on platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`);
|
|
||||||
}
|
|
||||||
return stableVersion;
|
|
||||||
}
|
}
|
||||||
version = super.evaluateVersions(versions);
|
version = super.evaluateVersions(versions);
|
||||||
return version;
|
return version;
|
||||||
|
|||||||
87
package-lock.json
generated
87
package-lock.json
generated
@@ -1658,9 +1658,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@nodable/entities": {
|
"node_modules/@nodable/entities": {
|
||||||
"version": "2.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-3.1.0.tgz",
|
||||||
"integrity": "sha512-nyT7T3nbMyBI/lvr6L5TyWbFJAI9FTgVRakNoBqCD+PmID8DzFrrNdLLtHMwMszOtqZa8PAOV24ZqDnQrhQINA==",
|
"integrity": "sha512-LsS/DjHr+uDM647Gru/cA8+J3a3HfhttwCKLyuoyN7yXTFCxKBtSgMQBvrW9yNPa2/zDRUNuGPaH5QUFoa4arQ==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -2891,6 +2891,18 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/anynum": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/anynum/-/anynum-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-N6//FLET/tXYNM/F6ABca1oH6fWB+KlTt909Le28WMDBk8oaT4vY17DCrwg2MvmuqUKt3Ni4N5dGJ/EoBgcO6A==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/NaturalIntelligence"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/argparse": {
|
"node_modules/argparse": {
|
||||||
"version": "1.0.10",
|
"version": "1.0.10",
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||||
@@ -3971,9 +3983,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/fast-xml-builder": {
|
"node_modules/fast-xml-builder": {
|
||||||
"version": "1.2.0",
|
"version": "1.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.3.1.tgz",
|
||||||
"integrity": "sha512-00aAWieqff+ZJhsXA4g1g7M8k+7AYoMUUHF+/zFb5U6Uv/P0Vl4QZo84/IcufzYalLuEj9928bXN9PbbFzMF0Q==",
|
"integrity": "sha512-pIM/1n3ntFXKYrUZwW7QCK0gAW7XY+wzj1YMIV3tLDvPj/V+zTGJK5e3/4WJfwj0qWw2ElNXiTixda/R+3YSug==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -3982,14 +3994,14 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"path-expression-matcher": "^1.5.0",
|
"path-expression-matcher": "^1.6.2",
|
||||||
"xml-naming": "^0.1.0"
|
"xml-naming": "^0.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fast-xml-parser": {
|
"node_modules/fast-xml-parser": {
|
||||||
"version": "5.7.2",
|
"version": "5.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.12.0.tgz",
|
||||||
"integrity": "sha512-P7oW7tLbYnhOLQk/Gv7cZgzgMPP/XN03K02/Jy6Y/NHzyIAIpxuZIM/YqAkfiXFPxA2CTm7NtCijK9EDu09u2w==",
|
"integrity": "sha512-/pXxRBtwxY9w8z7YbgsvIPPcPvFDsTbIkWwTQJhzNJPokj+TbN6ftmcv4j/pEQDvOCNnKGDzuk5Bo2oogIOiFg==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -3998,10 +4010,12 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodable/entities": "^2.1.0",
|
"@nodable/entities": "^3.1.0",
|
||||||
"fast-xml-builder": "^1.1.5",
|
"fast-xml-builder": "^1.3.1",
|
||||||
"path-expression-matcher": "^1.5.0",
|
"is-unsafe": "^2.0.3",
|
||||||
"strnum": "^2.2.3"
|
"path-expression-matcher": "^1.6.2",
|
||||||
|
"strnum": "^2.5.1",
|
||||||
|
"xml-naming": "^0.3.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"fxparser": "src/cli/cli.js"
|
"fxparser": "src/cli/cli.js"
|
||||||
@@ -4237,13 +4251,13 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/handlebars": {
|
"node_modules/handlebars": {
|
||||||
"version": "4.7.10",
|
"version": "4.7.9",
|
||||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.10.tgz",
|
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.9.tgz",
|
||||||
"integrity": "sha512-P5VJMVM7qgBn6vjXMw8WG9uVI+ncf2pi72j4de4yz5ZULLj2RGqLYaKOYGsgyrViQ0tePOVlN1tDCCXXtFqXKg==",
|
"integrity": "sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.8",
|
"minimist": "^1.2.5",
|
||||||
"neo-async": "^2.6.2",
|
"neo-async": "^2.6.2",
|
||||||
"source-map": "^0.6.1",
|
"source-map": "^0.6.1",
|
||||||
"wordwrap": "^1.0.0"
|
"wordwrap": "^1.0.0"
|
||||||
@@ -4453,6 +4467,18 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-unsafe": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-unsafe/-/is-unsafe-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-ZBllczCCO267vgdFb6Tq3pv+LhHaCiGMdr+ZsuL+OopruAg7S+3ZDs1vD0RPC0uSrkjzbraxaGjtX1YBxjPeFQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/NaturalIntelligence"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/isexe": {
|
"node_modules/isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
@@ -5742,9 +5768,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/path-expression-matcher": {
|
"node_modules/path-expression-matcher": {
|
||||||
"version": "1.5.0",
|
"version": "1.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.6.2.tgz",
|
||||||
"integrity": "sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ==",
|
"integrity": "sha512-enSlaiat05iasnzmgNxRj8reFdj3puY2QpNgP1aPIaVfT6nn9ICuPoFlKHk8EN22HcwewshO+mN2DGbkCEOtqQ==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -6356,16 +6382,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/strnum": {
|
"node_modules/strnum": {
|
||||||
"version": "2.2.3",
|
"version": "2.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.5.1.tgz",
|
||||||
"integrity": "sha512-oKx6RUCuHfT3oyVjtnrmn19H1SiCqgJSg+54XqURKp5aCMbrXrhLjRN9TjuwMjiYstZ0MzDrHqkGZ5dFTKd+zg==",
|
"integrity": "sha512-UM4nTLWzQiDBseVxUGxN0wJzIk0UU89Qi7pKXz9qISo+lhviJikTuikBsK/oFRlpvYHvSdz0TVoLyQ+sEpYwxA==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/NaturalIntelligence"
|
"url": "https://github.com/sponsors/NaturalIntelligence"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT"
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"anynum": "^1.0.1"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/supports-color": {
|
"node_modules/supports-color": {
|
||||||
"version": "7.2.0",
|
"version": "7.2.0",
|
||||||
@@ -6899,9 +6928,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/xml-naming": {
|
"node_modules/xml-naming": {
|
||||||
"version": "0.1.0",
|
"version": "0.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.3.0.tgz",
|
||||||
"integrity": "sha512-k8KO9hrMyNk6tUWqUfkTEZbezRRpONVOzUTnc97VnCvyj6Tf9lyUR9EDAIeiVLv56jsMcoXEwjW8Kv5yPY52lw==",
|
"integrity": "sha512-ghig2TBE/H11aOVgmahA3MhimvkBr6JIYknH/Dhdk10nXwdbIqBJsbfMxpvFPG8bAw77gN29aQWvKpmVoPlvPQ==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import path from 'node:path';
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
import semver from 'semver';
|
|
||||||
|
|
||||||
import BaseDistribution from '../base-distribution.js';
|
import BaseDistribution from '../base-distribution.js';
|
||||||
import {NodeInputs, INodeVersion, INodeVersionInfo} from '../base-models.js';
|
import {NodeInputs, INodeVersion, INodeVersionInfo} from '../base-models.js';
|
||||||
@@ -196,18 +195,7 @@ export default class OfficialBuilds extends BaseDistribution {
|
|||||||
|
|
||||||
if (this.isLatestSyntax(this.nodeInfo.versionSpec)) {
|
if (this.isLatestSyntax(this.nodeInfo.versionSpec)) {
|
||||||
core.info(`getting latest node version...`);
|
core.info(`getting latest node version...`);
|
||||||
|
return versions[0];
|
||||||
const stableVersion = versions.find(
|
|
||||||
potential => semver.prerelease(potential) === null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!stableVersion) {
|
|
||||||
throw new Error(
|
|
||||||
`Unable to find a stable Node version for '${this.nodeInfo.versionSpec}' on platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return stableVersion;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
version = super.evaluateVersions(versions);
|
version = super.evaluateVersions(versions);
|
||||||
|
|||||||
Reference in New Issue
Block a user