mirror of
https://github.com/actions/setup-node.git
synced 2025-07-04 08:33:47 +00:00
fix toolcache
This commit is contained in:
parent
e7c919e11c
commit
60732b4966
3 changed files with 34 additions and 4 deletions
13
dist/setup/index.js
vendored
13
dist/setup/index.js
vendored
|
@ -73226,7 +73226,13 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
|
|||
// check cache
|
||||
core.debug('check toolcache');
|
||||
let toolPath;
|
||||
toolPath = tc.find('node', versionSpec, osArch);
|
||||
if (isNightly) {
|
||||
const nightlyVersion = findNightlyVersionInHostedToolcache(versionSpec, osArch);
|
||||
toolPath = tc.find('node', nightlyVersion, osArch);
|
||||
}
|
||||
else {
|
||||
toolPath = tc.find('node', versionSpec, osArch);
|
||||
}
|
||||
// If not found in cache, download
|
||||
if (toolPath) {
|
||||
core.info(`Found in cache @ ${toolPath}`);
|
||||
|
@ -73322,6 +73328,11 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
|
|||
});
|
||||
}
|
||||
exports.getNode = getNode;
|
||||
function findNightlyVersionInHostedToolcache(versionsSpec, osArch) {
|
||||
const foundAllVersions = tc.findAllVersions('node', osArch);
|
||||
const version = evaluateVersions(foundAllVersions, versionsSpec);
|
||||
return version;
|
||||
}
|
||||
function isLtsAlias(versionSpec) {
|
||||
return versionSpec.startsWith('lts/');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue