Skip to content

Commit 623cf20

Browse files
renovate-botIan Lewis
and
Ian Lewis
authored
fix(deps): update npm (#535)
* fix(deps): update npm --------- Signed-off-by: Renovate Bot <[email protected]> Signed-off-by: Ian Lewis <[email protected]> Co-authored-by: Ian Lewis <[email protected]>
1 parent e7279e8 commit 623cf20

File tree

3 files changed

+80
-100
lines changed

3 files changed

+80
-100
lines changed

actions/installer/dist/index.js

+61-81
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ const file_command_1 = __nccwpck_require__(717);
353353
const utils_1 = __nccwpck_require__(5278);
354354
const os = __importStar(__nccwpck_require__(2037));
355355
const path = __importStar(__nccwpck_require__(1017));
356-
const uuid_1 = __nccwpck_require__(5840);
357356
const oidc_utils_1 = __nccwpck_require__(8041);
358357
/**
359358
* The code to exit an action
@@ -383,20 +382,9 @@ function exportVariable(name, val) {
383382
process.env[name] = convertedVal;
384383
const filePath = process.env['GITHUB_ENV'] || '';
385384
if (filePath) {
386-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
387-
// These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
388-
if (name.includes(delimiter)) {
389-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
390-
}
391-
if (convertedVal.includes(delimiter)) {
392-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
393-
}
394-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
395-
file_command_1.issueCommand('ENV', commandValue);
396-
}
397-
else {
398-
command_1.issueCommand('set-env', { name }, convertedVal);
385+
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
399386
}
387+
command_1.issueCommand('set-env', { name }, convertedVal);
400388
}
401389
exports.exportVariable = exportVariable;
402390
/**
@@ -414,7 +402,7 @@ exports.setSecret = setSecret;
414402
function addPath(inputPath) {
415403
const filePath = process.env['GITHUB_PATH'] || '';
416404
if (filePath) {
417-
file_command_1.issueCommand('PATH', inputPath);
405+
file_command_1.issueFileCommand('PATH', inputPath);
418406
}
419407
else {
420408
command_1.issueCommand('add-path', {}, inputPath);
@@ -454,7 +442,10 @@ function getMultilineInput(name, options) {
454442
const inputs = getInput(name, options)
455443
.split('\n')
456444
.filter(x => x !== '');
457-
return inputs;
445+
if (options && options.trimWhitespace === false) {
446+
return inputs;
447+
}
448+
return inputs.map(input => input.trim());
458449
}
459450
exports.getMultilineInput = getMultilineInput;
460451
/**
@@ -487,8 +478,12 @@ exports.getBooleanInput = getBooleanInput;
487478
*/
488479
// eslint-disable-next-line @typescript-eslint/no-explicit-any
489480
function setOutput(name, value) {
481+
const filePath = process.env['GITHUB_OUTPUT'] || '';
482+
if (filePath) {
483+
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
484+
}
490485
process.stdout.write(os.EOL);
491-
command_1.issueCommand('set-output', { name }, value);
486+
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
492487
}
493488
exports.setOutput = setOutput;
494489
/**
@@ -617,7 +612,11 @@ exports.group = group;
617612
*/
618613
// eslint-disable-next-line @typescript-eslint/no-explicit-any
619614
function saveState(name, value) {
620-
command_1.issueCommand('save-state', { name }, value);
615+
const filePath = process.env['GITHUB_STATE'] || '';
616+
if (filePath) {
617+
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
618+
}
619+
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
621620
}
622621
exports.saveState = saveState;
623622
/**
@@ -683,13 +682,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
683682
return result;
684683
};
685684
Object.defineProperty(exports, "__esModule", ({ value: true }));
686-
exports.issueCommand = void 0;
685+
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
687686
// We use any as a valid input type
688687
/* eslint-disable @typescript-eslint/no-explicit-any */
689688
const fs = __importStar(__nccwpck_require__(7147));
690689
const os = __importStar(__nccwpck_require__(2037));
690+
const uuid_1 = __nccwpck_require__(5840);
691691
const utils_1 = __nccwpck_require__(5278);
692-
function issueCommand(command, message) {
692+
function issueFileCommand(command, message) {
693693
const filePath = process.env[`GITHUB_${command}`];
694694
if (!filePath) {
695695
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -701,7 +701,22 @@ function issueCommand(command, message) {
701701
encoding: 'utf8'
702702
});
703703
}
704-
exports.issueCommand = issueCommand;
704+
exports.issueFileCommand = issueFileCommand;
705+
function prepareKeyValueMessage(key, value) {
706+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
707+
const convertedValue = utils_1.toCommandValue(value);
708+
// These should realistically never happen, but just in case someone finds a
709+
// way to exploit uuid generation let's not allow keys or values that contain
710+
// the delimiter.
711+
if (key.includes(delimiter)) {
712+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
713+
}
714+
if (convertedValue.includes(delimiter)) {
715+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
716+
}
717+
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
718+
}
719+
exports.prepareKeyValueMessage = prepareKeyValueMessage;
705720
//# sourceMappingURL=file-command.js.map
706721

707722
/***/ }),
@@ -2023,8 +2038,9 @@ exports.context = new Context.Context();
20232038
* @param token the repo PAT or GITHUB_TOKEN
20242039
* @param options other options to set
20252040
*/
2026-
function getOctokit(token, options) {
2027-
return new utils_1.GitHub(utils_1.getOctokitOptions(token, options));
2041+
function getOctokit(token, options, ...additionalPlugins) {
2042+
const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
2043+
return new GitHubWithPlugins(utils_1.getOctokitOptions(token, options));
20282044
}
20292045
exports.getOctokit = getOctokit;
20302046
//# sourceMappingURL=github.js.map
@@ -2106,7 +2122,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
21062122
return result;
21072123
};
21082124
Object.defineProperty(exports, "__esModule", ({ value: true }));
2109-
exports.getOctokitOptions = exports.GitHub = exports.context = void 0;
2125+
exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
21102126
const Context = __importStar(__nccwpck_require__(4087));
21112127
const Utils = __importStar(__nccwpck_require__(7914));
21122128
// octokit + plugins
@@ -2115,13 +2131,13 @@ const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
21152131
const plugin_paginate_rest_1 = __nccwpck_require__(4193);
21162132
exports.context = new Context.Context();
21172133
const baseUrl = Utils.getApiBaseUrl();
2118-
const defaults = {
2134+
exports.defaults = {
21192135
baseUrl,
21202136
request: {
21212137
agent: Utils.getProxyAgent(baseUrl)
21222138
}
21232139
};
2124-
exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults);
2140+
exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
21252141
/**
21262142
* Convience function to correctly format Octokit Options to pass into the constructor.
21272143
*
@@ -2945,11 +2961,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
29452961
};
29462962
var _a;
29472963
Object.defineProperty(exports, "__esModule", ({ value: true }));
2948-
exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
2964+
exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
29492965
const fs = __importStar(__nccwpck_require__(7147));
29502966
const path = __importStar(__nccwpck_require__(1017));
2951-
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
2967+
_a = fs.promises
2968+
// export const {open} = 'fs'
2969+
, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
2970+
// export const {open} = 'fs'
29522971
exports.IS_WINDOWS = process.platform === 'win32';
2972+
// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
2973+
exports.UV_FS_O_EXLOCK = 0x10000000;
2974+
exports.READONLY = fs.constants.O_RDONLY;
29532975
function exists(fsPath) {
29542976
return __awaiter(this, void 0, void 0, function* () {
29552977
try {
@@ -3130,12 +3152,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31303152
Object.defineProperty(exports, "__esModule", ({ value: true }));
31313153
exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
31323154
const assert_1 = __nccwpck_require__(9491);
3133-
const childProcess = __importStar(__nccwpck_require__(2081));
31343155
const path = __importStar(__nccwpck_require__(1017));
3135-
const util_1 = __nccwpck_require__(3837);
31363156
const ioUtil = __importStar(__nccwpck_require__(1962));
3137-
const exec = util_1.promisify(childProcess.exec);
3138-
const execFile = util_1.promisify(childProcess.execFile);
31393157
/**
31403158
* Copies a file or folder.
31413159
* Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
@@ -3216,61 +3234,23 @@ exports.mv = mv;
32163234
function rmRF(inputPath) {
32173235
return __awaiter(this, void 0, void 0, function* () {
32183236
if (ioUtil.IS_WINDOWS) {
3219-
// Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
3220-
// program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
32213237
// Check for invalid characters
32223238
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
32233239
if (/[*"<>|]/.test(inputPath)) {
32243240
throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
32253241
}
3226-
try {
3227-
const cmdPath = ioUtil.getCmdPath();
3228-
if (yield ioUtil.isDirectory(inputPath, true)) {
3229-
yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
3230-
env: { inputPath }
3231-
});
3232-
}
3233-
else {
3234-
yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
3235-
env: { inputPath }
3236-
});
3237-
}
3238-
}
3239-
catch (err) {
3240-
// if you try to delete a file that doesn't exist, desired result is achieved
3241-
// other errors are valid
3242-
if (err.code !== 'ENOENT')
3243-
throw err;
3244-
}
3245-
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
3246-
try {
3247-
yield ioUtil.unlink(inputPath);
3248-
}
3249-
catch (err) {
3250-
// if you try to delete a file that doesn't exist, desired result is achieved
3251-
// other errors are valid
3252-
if (err.code !== 'ENOENT')
3253-
throw err;
3254-
}
32553242
}
3256-
else {
3257-
let isDir = false;
3258-
try {
3259-
isDir = yield ioUtil.isDirectory(inputPath);
3260-
}
3261-
catch (err) {
3262-
// if you try to delete a file that doesn't exist, desired result is achieved
3263-
// other errors are valid
3264-
if (err.code !== 'ENOENT')
3265-
throw err;
3266-
return;
3267-
}
3268-
if (isDir) {
3269-
yield execFile(`rm`, [`-rf`, `${inputPath}`]);
3270-
}
3271-
else {
3272-
yield ioUtil.unlink(inputPath);
3273-
}
3243+
try {
3244+
// note if path does not exist, error is silent
3245+
yield ioUtil.rm(inputPath, {
3246+
force: true,
3247+
maxRetries: 3,
3248+
recursive: true,
3249+
retryDelay: 300
3250+
});
3251+
}
3252+
catch (err) {
3253+
throw new Error(`File was unable to be removed ${err}`);
32743254
}
32753255
});
32763256
}

actions/installer/dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

actions/installer/package-lock.json

+18-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)