Compare commits

..

5 Commits

Author SHA1 Message Date
Nikolai Laevskii
e52912ef25 Update tests 2023-10-19 17:12:39 +02:00
Nikolai Laevskii
ac16ae42d7 Update message to use waning instead of info 2023-10-19 16:59:10 +02:00
Nikolai Laevskii
5a8d9111e3 Update build 2023-10-19 14:31:08 +02:00
Nikolai Laevskii
9e956a555c Add notice about binaries not being updated yet 2023-10-19 13:43:56 +02:00
dependabot[bot]
7da2a7eb0c
Bump @babel/traverse from 7.15.4 to 7.23.2 (#870) 2023-10-19 10:40:59 +02:00
9 changed files with 4261 additions and 5005 deletions

Binary file not shown.

View File

@ -385,7 +385,7 @@ describe('setup-node', () => {
'Not found in manifest. Falling back to download directly from Node' 'Not found in manifest. Falling back to download directly from Node'
); );
expect(dlSpy).toHaveBeenCalled(); expect(dlSpy).toHaveBeenCalled();
expect(logSpy).toHaveBeenCalledWith( expect(warningSpy).toHaveBeenCalledWith(
`Node version ${versionSpec} for platform ${os.platform} and architecture ${os.arch} was found but failed to download. ` + `Node version ${versionSpec} for platform ${os.platform} and architecture ${os.arch} was found but failed to download. ` +
'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' + 'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' +
'To resolve this issue you may either fall back to the older version or try again later.' 'To resolve this issue you may either fall back to the older version or try again later.'

View File

@ -60332,86 +60332,90 @@ exports.debug = debug; // for test
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
}) : (function(o, m, k, k2) { if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
if (k2 === undefined) k2 = k; desc = { enumerable: true, get: function() { return m[k]; } };
o[k2] = m[k]; }
})); Object.defineProperty(o, k2, desc);
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { }) : (function(o, m, k, k2) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); if (k2 === undefined) k2 = k;
}) : function(o, v) { o[k2] = m[k];
o["default"] = v; }));
}); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(o, "default", { enumerable: true, value: v });
if (mod && mod.__esModule) return mod; }) : function(o, v) {
var result = {}; o["default"] = v;
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); });
__setModuleDefault(result, mod); var __importStar = (this && this.__importStar) || function (mod) {
return result; if (mod && mod.__esModule) return mod;
}; var result = {};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } __setModuleDefault(result, mod);
return new (P || (P = Promise))(function (resolve, reject) { return result;
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } };
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
step((generator = generator.apply(thisArg, _arguments || [])).next()); return new (P || (P = Promise))(function (resolve, reject) {
}); function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
}; function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
Object.defineProperty(exports, "__esModule", ({ value: true })); function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
exports.run = void 0; step((generator = generator.apply(thisArg, _arguments || [])).next());
const core = __importStar(__nccwpck_require__(2186)); });
const cache = __importStar(__nccwpck_require__(7799)); };
const constants_1 = __nccwpck_require__(9042); Object.defineProperty(exports, "__esModule", ({ value: true }));
const cache_utils_1 = __nccwpck_require__(1678); exports.run = void 0;
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in const core = __importStar(__nccwpck_require__(2186));
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to const cache = __importStar(__nccwpck_require__(7799));
// throw an uncaught exception. Instead of failing this action, just warn. const constants_1 = __nccwpck_require__(9042);
process.on('uncaughtException', e => { const cache_utils_1 = __nccwpck_require__(1678);
const warningPrefix = '[warning]'; // Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
core.info(`${warningPrefix}${e.message}`); // @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
}); // throw an uncaught exception. Instead of failing this action, just warn.
function run() { process.on('uncaughtException', e => {
return __awaiter(this, void 0, void 0, function* () { const warningPrefix = '[warning]';
try { core.info(`${warningPrefix}${e.message}`);
const cacheLock = core.getState(constants_1.State.CachePackageManager); });
yield cachePackages(cacheLock); function run() {
} return __awaiter(this, void 0, void 0, function* () {
catch (error) { try {
core.setFailed(error.message); const cacheLock = core.getState(constants_1.State.CachePackageManager);
} yield cachePackages(cacheLock);
}); }
} catch (error) {
exports.run = run; core.setFailed(error.message);
const cachePackages = (packageManager) => __awaiter(void 0, void 0, void 0, function* () { }
const state = core.getState(constants_1.State.CacheMatchedKey); });
const primaryKey = core.getState(constants_1.State.CachePrimaryKey); }
const cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]'); exports.run = run;
const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(packageManager); const cachePackages = (packageManager) => __awaiter(void 0, void 0, void 0, function* () {
if (!packageManagerInfo) { const state = core.getState(constants_1.State.CacheMatchedKey);
core.debug(`Caching for '${packageManager}' is not supported`); const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
return; const cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]');
} const packageManagerInfo = yield (0, cache_utils_1.getPackageManagerInfo)(packageManager);
if (!cachePaths.length) { if (!packageManagerInfo) {
// TODO: core.getInput has a bug - it can return undefined despite its definition (tests only?) core.debug(`Caching for '${packageManager}' is not supported`);
// export declare function getInput(name: string, options?: InputOptions): string; return;
const cacheDependencyPath = core.getInput('cache-dependency-path') || ''; }
throw new Error(`Cache folder paths are not retrieved for ${packageManager} with cache-dependency-path = ${cacheDependencyPath}`); if (!cachePaths.length) {
} // TODO: core.getInput has a bug - it can return undefined despite its definition (tests only?)
if (primaryKey === state) { // export declare function getInput(name: string, options?: InputOptions): string;
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`); const cacheDependencyPath = core.getInput('cache-dependency-path') || '';
return; throw new Error(`Cache folder paths are not retrieved for ${packageManager} with cache-dependency-path = ${cacheDependencyPath}`);
} }
const cacheId = yield cache.saveCache(cachePaths, primaryKey); if (primaryKey === state) {
if (cacheId == -1) { core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
return; return;
} }
core.info(`Cache saved with the key: ${primaryKey}`); const cacheId = yield cache.saveCache(cachePaths, primaryKey);
}); if (cacheId == -1) {
run(); return;
}
core.info(`Cache saved with the key: ${primaryKey}`);
});
run();
/***/ }), /***/ }),
@ -60420,254 +60424,258 @@ run();
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
}) : (function(o, m, k, k2) { if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
if (k2 === undefined) k2 = k; desc = { enumerable: true, get: function() { return m[k]; } };
o[k2] = m[k]; }
})); Object.defineProperty(o, k2, desc);
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { }) : (function(o, m, k, k2) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); if (k2 === undefined) k2 = k;
}) : function(o, v) { o[k2] = m[k];
o["default"] = v; }));
}); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(o, "default", { enumerable: true, value: v });
if (mod && mod.__esModule) return mod; }) : function(o, v) {
var result = {}; o["default"] = v;
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); });
__setModuleDefault(result, mod); var __importStar = (this && this.__importStar) || function (mod) {
return result; if (mod && mod.__esModule) return mod;
}; var result = {};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } __setModuleDefault(result, mod);
return new (P || (P = Promise))(function (resolve, reject) { return result;
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } };
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
step((generator = generator.apply(thisArg, _arguments || [])).next()); return new (P || (P = Promise))(function (resolve, reject) {
}); function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
}; function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
var __importDefault = (this && this.__importDefault) || function (mod) { function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
return (mod && mod.__esModule) ? mod : { "default": mod }; step((generator = generator.apply(thisArg, _arguments || [])).next());
}; });
Object.defineProperty(exports, "__esModule", ({ value: true })); };
exports.isCacheFeatureAvailable = exports.isGhes = exports.repoHasYarnBerryManagedDependencies = exports.getCacheDirectories = exports.resetProjectDirectoriesMemoized = exports.getPackageManagerInfo = exports.getCommandOutputNotEmpty = exports.getCommandOutput = exports.supportedPackageManagers = void 0; var __importDefault = (this && this.__importDefault) || function (mod) {
const core = __importStar(__nccwpck_require__(2186)); return (mod && mod.__esModule) ? mod : { "default": mod };
const exec = __importStar(__nccwpck_require__(1514)); };
const cache = __importStar(__nccwpck_require__(7799)); Object.defineProperty(exports, "__esModule", ({ value: true }));
const glob = __importStar(__nccwpck_require__(8090)); exports.isCacheFeatureAvailable = exports.isGhes = exports.repoHasYarnBerryManagedDependencies = exports.getCacheDirectories = exports.resetProjectDirectoriesMemoized = exports.getPackageManagerInfo = exports.getCommandOutputNotEmpty = exports.getCommandOutput = exports.supportedPackageManagers = void 0;
const path_1 = __importDefault(__nccwpck_require__(1017)); const core = __importStar(__nccwpck_require__(2186));
const fs_1 = __importDefault(__nccwpck_require__(7147)); const exec = __importStar(__nccwpck_require__(1514));
const util_1 = __nccwpck_require__(2629); const cache = __importStar(__nccwpck_require__(7799));
exports.supportedPackageManagers = { const glob = __importStar(__nccwpck_require__(8090));
npm: { const path_1 = __importDefault(__nccwpck_require__(1017));
name: 'npm', const fs_1 = __importDefault(__nccwpck_require__(7147));
lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'], const util_1 = __nccwpck_require__(2629);
getCacheFolderPath: () => exports.getCommandOutputNotEmpty('npm config get cache', 'Could not get npm cache folder path') exports.supportedPackageManagers = {
}, npm: {
pnpm: { name: 'npm',
name: 'pnpm', lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'],
lockFilePatterns: ['pnpm-lock.yaml'], getCacheFolderPath: () => (0, exports.getCommandOutputNotEmpty)('npm config get cache', 'Could not get npm cache folder path')
getCacheFolderPath: () => exports.getCommandOutputNotEmpty('pnpm store path --silent', 'Could not get pnpm cache folder path') },
}, pnpm: {
yarn: { name: 'pnpm',
name: 'yarn', lockFilePatterns: ['pnpm-lock.yaml'],
lockFilePatterns: ['yarn.lock'], getCacheFolderPath: () => (0, exports.getCommandOutputNotEmpty)('pnpm store path --silent', 'Could not get pnpm cache folder path')
getCacheFolderPath: (projectDir) => __awaiter(void 0, void 0, void 0, function* () { },
const yarnVersion = yield exports.getCommandOutputNotEmpty(`yarn --version`, 'Could not retrieve version of yarn', projectDir); yarn: {
core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`); name: 'yarn',
const stdOut = yarnVersion.startsWith('1.') lockFilePatterns: ['yarn.lock'],
? yield exports.getCommandOutput('yarn cache dir', projectDir) getCacheFolderPath: (projectDir) => __awaiter(void 0, void 0, void 0, function* () {
: yield exports.getCommandOutput('yarn config get cacheFolder', projectDir); const yarnVersion = yield (0, exports.getCommandOutputNotEmpty)(`yarn --version`, 'Could not retrieve version of yarn', projectDir);
if (!stdOut) { core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`);
throw new Error(`Could not get yarn cache folder path for ${projectDir}`); const stdOut = yarnVersion.startsWith('1.')
} ? yield (0, exports.getCommandOutput)('yarn cache dir', projectDir)
return stdOut; : yield (0, exports.getCommandOutput)('yarn config get cacheFolder', projectDir);
}) if (!stdOut) {
} throw new Error(`Could not get yarn cache folder path for ${projectDir}`);
}; }
const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0, function* () { return stdOut;
let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, Object.assign({ ignoreReturnCode: true }, (cwd && { cwd }))); })
if (exitCode) { }
stderr = !stderr.trim() };
? `The '${toolCommand}' command failed with exit code: ${exitCode}` const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0, function* () {
: stderr; let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, Object.assign({ ignoreReturnCode: true }, (cwd && { cwd })));
throw new Error(stderr); if (exitCode) {
} stderr = !stderr.trim()
return stdout.trim(); ? `The '${toolCommand}' command failed with exit code: ${exitCode}`
}); : stderr;
exports.getCommandOutput = getCommandOutput; throw new Error(stderr);
const getCommandOutputNotEmpty = (toolCommand, error, cwd) => __awaiter(void 0, void 0, void 0, function* () { }
const stdOut = exports.getCommandOutput(toolCommand, cwd); return stdout.trim();
if (!stdOut) { });
throw new Error(error); exports.getCommandOutput = getCommandOutput;
} const getCommandOutputNotEmpty = (toolCommand, error, cwd) => __awaiter(void 0, void 0, void 0, function* () {
return stdOut; const stdOut = (0, exports.getCommandOutput)(toolCommand, cwd);
}); if (!stdOut) {
exports.getCommandOutputNotEmpty = getCommandOutputNotEmpty; throw new Error(error);
const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void 0, function* () { }
if (packageManager === 'npm') { return stdOut;
return exports.supportedPackageManagers.npm; });
} exports.getCommandOutputNotEmpty = getCommandOutputNotEmpty;
else if (packageManager === 'pnpm') { const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void 0, function* () {
return exports.supportedPackageManagers.pnpm; if (packageManager === 'npm') {
} return exports.supportedPackageManagers.npm;
else if (packageManager === 'yarn') { }
return exports.supportedPackageManagers.yarn; else if (packageManager === 'pnpm') {
} return exports.supportedPackageManagers.pnpm;
else { }
return null; else if (packageManager === 'yarn') {
} return exports.supportedPackageManagers.yarn;
}); }
exports.getPackageManagerInfo = getPackageManagerInfo; else {
/** return null;
* getProjectDirectoriesFromCacheDependencyPath is called twice during `restoreCache` }
* - first through `getCacheDirectories` });
* - second from `repoHasYarn3ManagedCache` exports.getPackageManagerInfo = getPackageManagerInfo;
* /**
* it contains expensive IO operation and thus should be memoized * getProjectDirectoriesFromCacheDependencyPath is called twice during `restoreCache`
*/ * - first through `getCacheDirectories`
let projectDirectoriesMemoized = null; * - second from `repoHasYarn3ManagedCache`
/** *
* unit test must reset memoized variables * it contains expensive IO operation and thus should be memoized
*/ */
const resetProjectDirectoriesMemoized = () => (projectDirectoriesMemoized = null); let projectDirectoriesMemoized = null;
exports.resetProjectDirectoriesMemoized = resetProjectDirectoriesMemoized; /**
/** * unit test must reset memoized variables
* Expands (converts) the string input `cache-dependency-path` to list of directories that */
* may be project roots const resetProjectDirectoriesMemoized = () => (projectDirectoriesMemoized = null);
* @param cacheDependencyPath - either a single string or multiline string with possible glob patterns exports.resetProjectDirectoriesMemoized = resetProjectDirectoriesMemoized;
* expected to be the result of `core.getInput('cache-dependency-path')` /**
* @return list of directories and possible * Expands (converts) the string input `cache-dependency-path` to list of directories that
*/ * may be project roots
const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () { * @param cacheDependencyPath - either a single string or multiline string with possible glob patterns
if (projectDirectoriesMemoized !== null) { * expected to be the result of `core.getInput('cache-dependency-path')`
return projectDirectoriesMemoized; * @return list of directories and possible
} */
const globber = yield glob.create(cacheDependencyPath); const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
const cacheDependenciesPaths = yield globber.glob(); if (projectDirectoriesMemoized !== null) {
const existingDirectories = cacheDependenciesPaths return projectDirectoriesMemoized;
.map(path_1.default.dirname) }
.filter(util_1.unique()) const globber = yield glob.create(cacheDependencyPath);
.map(dirName => fs_1.default.realpathSync(dirName)) const cacheDependenciesPaths = yield globber.glob();
.filter(directory => fs_1.default.lstatSync(directory).isDirectory()); const existingDirectories = cacheDependenciesPaths
if (!existingDirectories.length) .map(path_1.default.dirname)
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`); .filter((0, util_1.unique)())
projectDirectoriesMemoized = existingDirectories; .map(dirName => fs_1.default.realpathSync(dirName))
return existingDirectories; .filter(directory => fs_1.default.lstatSync(directory).isDirectory());
}); if (!existingDirectories.length)
/** core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
* Finds the cache directories configured for the repo if cache-dependency-path is not empty projectDirectoriesMemoized = existingDirectories;
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM return existingDirectories;
* @param cacheDependencyPath - either a single string or multiline string with possible glob patterns });
* expected to be the result of `core.getInput('cache-dependency-path')` /**
* @return list of files on which the cache depends * Finds the cache directories configured for the repo if cache-dependency-path is not empty
*/ * @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
const getCacheDirectoriesFromCacheDependencyPath = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () { * @param cacheDependencyPath - either a single string or multiline string with possible glob patterns
const projectDirectories = yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath); * expected to be the result of `core.getInput('cache-dependency-path')`
const cacheFoldersPaths = yield Promise.all(projectDirectories.map((projectDirectory) => __awaiter(void 0, void 0, void 0, function* () { * @return list of files on which the cache depends
const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath(projectDirectory); */
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`); const getCacheDirectoriesFromCacheDependencyPath = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
return cacheFolderPath; const projectDirectories = yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath);
}))); const cacheFoldersPaths = yield Promise.all(projectDirectories.map((projectDirectory) => __awaiter(void 0, void 0, void 0, function* () {
// uniq in order to do not cache the same directories twice const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath(projectDirectory);
return cacheFoldersPaths.filter(util_1.unique()); core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`);
}); return cacheFolderPath;
/** })));
* Finds the cache directories configured for the repo ignoring cache-dependency-path // uniq in order to do not cache the same directories twice
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM return cacheFoldersPaths.filter((0, util_1.unique)());
* @return list of files on which the cache depends });
*/ /**
const getCacheDirectoriesForRootProject = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () { * Finds the cache directories configured for the repo ignoring cache-dependency-path
const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath(); * @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the root directory`); * @return list of files on which the cache depends
return [cacheFolderPath]; */
}); const getCacheDirectoriesForRootProject = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () {
/** const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath();
* A function to find the cache directories configured for the repo core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the root directory`);
* currently it handles only the case of PM=yarn && cacheDependencyPath is not empty return [cacheFolderPath];
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM });
* @param cacheDependencyPath - either a single string or multiline string with possible glob patterns /**
* expected to be the result of `core.getInput('cache-dependency-path')` * A function to find the cache directories configured for the repo
* @return list of files on which the cache depends * currently it handles only the case of PM=yarn && cacheDependencyPath is not empty
*/ * @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
const getCacheDirectories = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () { * @param cacheDependencyPath - either a single string or multiline string with possible glob patterns
// For yarn, if cacheDependencyPath is set, ask information about cache folders in each project * expected to be the result of `core.getInput('cache-dependency-path')`
// folder satisfied by cacheDependencyPath https://github.com/actions/setup-node/issues/488 * @return list of files on which the cache depends
if (packageManagerInfo.name === 'yarn' && cacheDependencyPath) { */
return getCacheDirectoriesFromCacheDependencyPath(packageManagerInfo, cacheDependencyPath); const getCacheDirectories = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
} // For yarn, if cacheDependencyPath is set, ask information about cache folders in each project
return getCacheDirectoriesForRootProject(packageManagerInfo); // folder satisfied by cacheDependencyPath https://github.com/actions/setup-node/issues/488
}); if (packageManagerInfo.name === 'yarn' && cacheDependencyPath) {
exports.getCacheDirectories = getCacheDirectories; return getCacheDirectoriesFromCacheDependencyPath(packageManagerInfo, cacheDependencyPath);
/** }
* A function to check if the directory is a yarn project configured to manage return getCacheDirectoriesForRootProject(packageManagerInfo);
* obsolete dependencies in the local cache });
* @param directory - a path to the folder exports.getCacheDirectories = getCacheDirectories;
* @return - true if the directory's project is yarn managed /**
* - if there's .yarn/cache folder do not mess with the dependencies kept in the repo, return false * A function to check if the directory is a yarn project configured to manage
* - global cache is not managed by yarn @see https://yarnpkg.com/features/offline-cache, return false * obsolete dependencies in the local cache
* - if local cache is not explicitly enabled (not yarn3), return false * @param directory - a path to the folder
* - return true otherwise * @return - true if the directory's project is yarn managed
*/ * - if there's .yarn/cache folder do not mess with the dependencies kept in the repo, return false
const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0, void 0, void 0, function* () { * - global cache is not managed by yarn @see https://yarnpkg.com/features/offline-cache, return false
const workDir = directory || process.env.GITHUB_WORKSPACE || '.'; * - if local cache is not explicitly enabled (not yarn3), return false
core.debug(`check if "${workDir}" has locally managed yarn3 dependencies`); * - return true otherwise
// if .yarn/cache directory exists the cache is managed by version control system */
const yarnCacheFile = path_1.default.join(workDir, '.yarn', 'cache'); const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0, void 0, void 0, function* () {
if (fs_1.default.existsSync(yarnCacheFile) && const workDir = directory || process.env.GITHUB_WORKSPACE || '.';
fs_1.default.lstatSync(yarnCacheFile).isDirectory()) { core.debug(`check if "${workDir}" has locally managed yarn3 dependencies`);
core.debug(`"${workDir}" has .yarn/cache - dependencies are kept in the repository`); // if .yarn/cache directory exists the cache is managed by version control system
return Promise.resolve(false); const yarnCacheFile = path_1.default.join(workDir, '.yarn', 'cache');
} if (fs_1.default.existsSync(yarnCacheFile) &&
// NOTE: yarn1 returns 'undefined' with return code = 0 fs_1.default.lstatSync(yarnCacheFile).isDirectory()) {
const enableGlobalCache = yield exports.getCommandOutput('yarn config get enableGlobalCache', workDir); core.debug(`"${workDir}" has .yarn/cache - dependencies are kept in the repository`);
// only local cache is not managed by yarn return Promise.resolve(false);
const managed = enableGlobalCache.includes('false'); }
if (managed) { // NOTE: yarn1 returns 'undefined' with return code = 0
core.debug(`"${workDir}" dependencies are managed by yarn 3 locally`); const enableGlobalCache = yield (0, exports.getCommandOutput)('yarn config get enableGlobalCache', workDir);
return true; // only local cache is not managed by yarn
} const managed = enableGlobalCache.includes('false');
else { if (managed) {
core.debug(`"${workDir}" dependencies are not managed by yarn 3 locally`); core.debug(`"${workDir}" dependencies are managed by yarn 3 locally`);
return false; return true;
} }
}); else {
/** core.debug(`"${workDir}" dependencies are not managed by yarn 3 locally`);
* A function to report the repo contains Yarn managed projects return false;
* @param packageManagerInfo - used to make sure current package manager is yarn }
* @param cacheDependencyPath - either a single string or multiline string with possible glob patterns });
* expected to be the result of `core.getInput('cache-dependency-path')` /**
* @return - true if all project directories configured to be Yarn managed * A function to report the repo contains Yarn managed projects
*/ * @param packageManagerInfo - used to make sure current package manager is yarn
const repoHasYarnBerryManagedDependencies = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () { * @param cacheDependencyPath - either a single string or multiline string with possible glob patterns
if (packageManagerInfo.name !== 'yarn') * expected to be the result of `core.getInput('cache-dependency-path')`
return false; * @return - true if all project directories configured to be Yarn managed
const yarnDirs = cacheDependencyPath */
? yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath) const repoHasYarnBerryManagedDependencies = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
: ['']; if (packageManagerInfo.name !== 'yarn')
const isManagedList = yield Promise.all(yarnDirs.map(projectHasYarnBerryManagedDependencies)); return false;
return isManagedList.every(Boolean); const yarnDirs = cacheDependencyPath
}); ? yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath)
exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies; : [''];
function isGhes() { const isManagedList = yield Promise.all(yarnDirs.map(projectHasYarnBerryManagedDependencies));
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com'); return isManagedList.every(Boolean);
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM'; });
} exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies;
exports.isGhes = isGhes; function isGhes() {
function isCacheFeatureAvailable() { const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
if (cache.isFeatureAvailable()) return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
return true; }
if (isGhes()) { exports.isGhes = isGhes;
core.warning('Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.'); function isCacheFeatureAvailable() {
return false; if (cache.isFeatureAvailable())
} return true;
core.warning('The runner was not able to contact the cache service. Caching will be skipped'); if (isGhes()) {
return false; core.warning('Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.');
} return false;
exports.isCacheFeatureAvailable = isCacheFeatureAvailable; }
core.warning('The runner was not able to contact the cache service. Caching will be skipped');
return false;
}
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ }), /***/ }),
@ -60676,26 +60684,26 @@ exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Outputs = exports.State = exports.LockType = void 0; exports.Outputs = exports.State = exports.LockType = void 0;
var LockType; var LockType;
(function (LockType) { (function (LockType) {
LockType["Npm"] = "npm"; LockType["Npm"] = "npm";
LockType["Pnpm"] = "pnpm"; LockType["Pnpm"] = "pnpm";
LockType["Yarn"] = "yarn"; LockType["Yarn"] = "yarn";
})(LockType = exports.LockType || (exports.LockType = {})); })(LockType = exports.LockType || (exports.LockType = {}));
var State; var State;
(function (State) { (function (State) {
State["CachePackageManager"] = "SETUP_NODE_CACHE_PACKAGE_MANAGER"; State["CachePackageManager"] = "SETUP_NODE_CACHE_PACKAGE_MANAGER";
State["CachePrimaryKey"] = "CACHE_KEY"; State["CachePrimaryKey"] = "CACHE_KEY";
State["CacheMatchedKey"] = "CACHE_RESULT"; State["CacheMatchedKey"] = "CACHE_RESULT";
State["CachePaths"] = "CACHE_PATHS"; State["CachePaths"] = "CACHE_PATHS";
})(State = exports.State || (exports.State = {})); })(State = exports.State || (exports.State = {}));
var Outputs; var Outputs;
(function (Outputs) { (function (Outputs) {
Outputs["CacheHit"] = "cache-hit"; Outputs["CacheHit"] = "cache-hit";
})(Outputs = exports.Outputs || (exports.Outputs = {})); })(Outputs = exports.Outputs || (exports.Outputs = {}));
/***/ }), /***/ }),
@ -60704,108 +60712,112 @@ var Outputs;
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
}) : (function(o, m, k, k2) { if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
if (k2 === undefined) k2 = k; desc = { enumerable: true, get: function() { return m[k]; } };
o[k2] = m[k]; }
})); Object.defineProperty(o, k2, desc);
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { }) : (function(o, m, k, k2) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); if (k2 === undefined) k2 = k;
}) : function(o, v) { o[k2] = m[k];
o["default"] = v; }));
}); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(o, "default", { enumerable: true, value: v });
if (mod && mod.__esModule) return mod; }) : function(o, v) {
var result = {}; o["default"] = v;
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); });
__setModuleDefault(result, mod); var __importStar = (this && this.__importStar) || function (mod) {
return result; if (mod && mod.__esModule) return mod;
}; var result = {};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } __setModuleDefault(result, mod);
return new (P || (P = Promise))(function (resolve, reject) { return result;
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } };
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
step((generator = generator.apply(thisArg, _arguments || [])).next()); return new (P || (P = Promise))(function (resolve, reject) {
}); function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
}; function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
Object.defineProperty(exports, "__esModule", ({ value: true })); function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
exports.unique = exports.printEnvDetailsAndSetOutput = exports.parseNodeVersionFile = void 0; step((generator = generator.apply(thisArg, _arguments || [])).next());
const core = __importStar(__nccwpck_require__(2186)); });
const exec = __importStar(__nccwpck_require__(1514)); };
function parseNodeVersionFile(contents) { Object.defineProperty(exports, "__esModule", ({ value: true }));
var _a, _b, _c; exports.unique = exports.printEnvDetailsAndSetOutput = exports.parseNodeVersionFile = void 0;
let nodeVersion; const core = __importStar(__nccwpck_require__(2186));
// Try parsing the file as an NPM `package.json` file. const exec = __importStar(__nccwpck_require__(1514));
try { function parseNodeVersionFile(contents) {
nodeVersion = (_a = JSON.parse(contents).volta) === null || _a === void 0 ? void 0 : _a.node; var _a, _b, _c;
if (!nodeVersion) let nodeVersion;
nodeVersion = (_b = JSON.parse(contents).engines) === null || _b === void 0 ? void 0 : _b.node; // Try parsing the file as an NPM `package.json` file.
} try {
catch (_d) { nodeVersion = (_a = JSON.parse(contents).volta) === null || _a === void 0 ? void 0 : _a.node;
core.info('Node version file is not JSON file'); if (!nodeVersion)
} nodeVersion = (_b = JSON.parse(contents).engines) === null || _b === void 0 ? void 0 : _b.node;
if (!nodeVersion) { }
const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m); catch (_d) {
nodeVersion = (_c = found === null || found === void 0 ? void 0 : found.groups) === null || _c === void 0 ? void 0 : _c.version; core.info('Node version file is not JSON file');
} }
// In the case of an unknown format, if (!nodeVersion) {
// return as is and evaluate the version separately. const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m);
if (!nodeVersion) nodeVersion = (_c = found === null || found === void 0 ? void 0 : found.groups) === null || _c === void 0 ? void 0 : _c.version;
nodeVersion = contents.trim(); }
return nodeVersion; // In the case of an unknown format,
} // return as is and evaluate the version separately.
exports.parseNodeVersionFile = parseNodeVersionFile; if (!nodeVersion)
function printEnvDetailsAndSetOutput() { nodeVersion = contents.trim();
return __awaiter(this, void 0, void 0, function* () { return nodeVersion;
core.startGroup('Environment details'); }
const promises = ['node', 'npm', 'yarn'].map((tool) => __awaiter(this, void 0, void 0, function* () { exports.parseNodeVersionFile = parseNodeVersionFile;
const output = yield getToolVersion(tool, ['--version']); function printEnvDetailsAndSetOutput() {
return { tool, output }; return __awaiter(this, void 0, void 0, function* () {
})); core.startGroup('Environment details');
const tools = yield Promise.all(promises); const promises = ['node', 'npm', 'yarn'].map((tool) => __awaiter(this, void 0, void 0, function* () {
tools.forEach(({ tool, output }) => { const output = yield getToolVersion(tool, ['--version']);
if (tool === 'node') { return { tool, output };
core.setOutput(`${tool}-version`, output); }));
} const tools = yield Promise.all(promises);
core.info(`${tool}: ${output}`); tools.forEach(({ tool, output }) => {
}); if (tool === 'node') {
core.endGroup(); core.setOutput(`${tool}-version`, output);
}); }
} core.info(`${tool}: ${output}`);
exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput; });
function getToolVersion(tool, options) { core.endGroup();
return __awaiter(this, void 0, void 0, function* () { });
try { }
const { stdout, stderr, exitCode } = yield exec.getExecOutput(tool, options, { exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput;
ignoreReturnCode: true, function getToolVersion(tool, options) {
silent: true return __awaiter(this, void 0, void 0, function* () {
}); try {
if (exitCode > 0) { const { stdout, stderr, exitCode } = yield exec.getExecOutput(tool, options, {
core.info(`[warning]${stderr}`); ignoreReturnCode: true,
return ''; silent: true
} });
return stdout.trim(); if (exitCode > 0) {
} core.info(`[warning]${stderr}`);
catch (err) { return '';
return ''; }
} return stdout.trim();
}); }
} catch (err) {
const unique = () => { return '';
const encountered = new Set(); }
return (value) => { });
if (encountered.has(value)) }
return false; const unique = () => {
encountered.add(value); const encountered = new Set();
return true; return (value) => {
}; if (encountered.has(value))
}; return false;
exports.unique = unique; encountered.add(value);
return true;
};
};
exports.unique = unique;
/***/ }), /***/ }),

2901
dist/setup/index.js vendored

File diff suppressed because it is too large Load Diff

5406
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -37,22 +37,22 @@
"uuid": "^9.0.0" "uuid": "^9.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^27.0.2", "@types/jest": "^29.5.6",
"@types/node": "^16.11.25", "@types/node": "^16.11.25",
"@types/semver": "^6.0.0", "@types/semver": "^6.0.0",
"@types/uuid": "^9.0.3", "@types/uuid": "^9.0.3",
"@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/parser": "^5.54.0",
"@vercel/ncc": "^0.33.4", "@vercel/ncc": "^0.38.0",
"eslint": "^8.35.0", "eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1", "eslint-plugin-jest": "^27.2.1",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"jest": "^27.2.5", "jest": "^29.7.0",
"jest-circus": "^27.2.5", "jest-circus": "^29.7.0",
"jest-each": "^27.2.5", "jest-each": "^29.7.0",
"prettier": "^2.8.4", "prettier": "^2.8.4",
"ts-jest": "^27.0.5", "ts-jest": "^29.1.1",
"typescript": "^4.2.3" "typescript": "^4.2.3"
} }
} }

View File

@ -17,7 +17,7 @@ export async function run() {
const cacheLock = core.getState(State.CachePackageManager); const cacheLock = core.getState(State.CachePackageManager);
await cachePackages(cacheLock); await cachePackages(cacheLock);
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed((error as Error).message);
} }
} }

View File

@ -18,6 +18,7 @@ export default class OfficialBuilds extends BaseDistribution {
let manifest: tc.IToolRelease[] | undefined; let manifest: tc.IToolRelease[] | undefined;
let nodeJsVersions: INodeVersion[] | undefined; let nodeJsVersions: INodeVersion[] | undefined;
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch); const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
if (this.isLtsAlias(this.nodeInfo.versionSpec)) { if (this.isLtsAlias(this.nodeInfo.versionSpec)) {
core.info('Attempt to resolve LTS alias from manifest...'); core.info('Attempt to resolve LTS alias from manifest...');
@ -61,19 +62,14 @@ export default class OfficialBuilds extends BaseDistribution {
if (toolPath) { if (toolPath) {
core.info(`Found in cache @ ${toolPath}`); core.info(`Found in cache @ ${toolPath}`);
this.addToolPath(toolPath);
if (this.osPlat != 'win32') {
toolPath = path.join(toolPath, 'bin');
}
core.addPath(toolPath);
return; return;
} }
let downloadPath = ''; let downloadPath = '';
core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
try { try {
core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
const versionInfo = await this.getInfoFromManifest( const versionInfo = await this.getInfoFromManifest(
this.nodeInfo.versionSpec, this.nodeInfo.versionSpec,
this.nodeInfo.stable, this.nodeInfo.stable,
@ -85,7 +81,6 @@ export default class OfficialBuilds extends BaseDistribution {
core.info( core.info(
`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}` `Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`
); );
downloadPath = await tc.downloadTool( downloadPath = await tc.downloadTool(
versionInfo.downloadUrl, versionInfo.downloadUrl,
undefined, undefined,
@ -110,9 +105,9 @@ export default class OfficialBuilds extends BaseDistribution {
`Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded` `Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`
); );
} else { } else {
core.info(err.message); core.info((err as Error).message);
} }
core.debug(err.stack); core.debug((err as Error).stack ?? 'empty stack');
core.info('Falling back to download directly from Node'); core.info('Falling back to download directly from Node');
} }
@ -127,6 +122,14 @@ export default class OfficialBuilds extends BaseDistribution {
core.addPath(toolPath); core.addPath(toolPath);
} }
protected addToolPath(toolPath: string) {
if (this.osPlat != 'win32') {
toolPath = path.join(toolPath, 'bin');
}
core.addPath(toolPath);
}
protected async downloadDirectlyFromNode() { protected async downloadDirectlyFromNode() {
const nodeJsVersions = await this.getNodeJsVersions(); const nodeJsVersions = await this.getNodeJsVersions();
const versions = this.filterVersions(nodeJsVersions); const versions = this.filterVersions(nodeJsVersions);
@ -145,7 +148,7 @@ export default class OfficialBuilds extends BaseDistribution {
return toolPath; return toolPath;
} catch (error) { } catch (error) {
if (error instanceof tc.HTTPError && error.httpStatusCode === 404) { if (error instanceof tc.HTTPError && error.httpStatusCode === 404) {
core.info( core.warning(
`Node version ${this.nodeInfo.versionSpec} for platform ${this.osPlat} and architecture ${this.nodeInfo.arch} was found but failed to download. ` + `Node version ${this.nodeInfo.versionSpec} for platform ${this.osPlat} and architecture ${this.nodeInfo.arch} was found but failed to download. ` +
'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' + 'This usually happens when downloadable binaries are not fully updated at https://nodejs.org/. ' +
'To resolve this issue you may either fall back to the older version or try again later.' 'To resolve this issue you may either fall back to the older version or try again later.'
@ -243,7 +246,7 @@ export default class OfficialBuilds extends BaseDistribution {
return info?.resolvedVersion; return info?.resolvedVersion;
} catch (err) { } catch (err) {
core.info('Unable to resolve version from manifest...'); core.info('Unable to resolve version from manifest...');
core.debug(err.message); core.debug((err as Error).message);
} }
} }

View File

@ -75,7 +75,7 @@ export async function run() {
`##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}` `##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}`
); );
} catch (err) { } catch (err) {
core.setFailed(err.message); core.setFailed((err as Error).message);
} }
} }