Skip to content

Commit 05c59af

Browse files
committed
Update dist file
Update dist file with latest changes. Signed-off-by: thc202 <thc202@gmail.com>
1 parent f49eab5 commit 05c59af

File tree

1 file changed

+102
-14
lines changed

1 file changed

+102
-14
lines changed

dist/index.js

Lines changed: 102 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,7 +2486,31 @@ function write(key, options) {
24862486
/* 79 */,
24872487
/* 80 */,
24882488
/* 81 */,
2489-
/* 82 */,
2489+
/* 82 */
2490+
/***/ (function(__unusedmodule, exports) {
2491+
2492+
"use strict";
2493+
2494+
// We use any as a valid input type
2495+
/* eslint-disable @typescript-eslint/no-explicit-any */
2496+
Object.defineProperty(exports, "__esModule", { value: true });
2497+
/**
2498+
* Sanitizes an input into a string so it can be passed into issueCommand safely
2499+
* @param input input to sanitize into a string
2500+
*/
2501+
function toCommandValue(input) {
2502+
if (input === null || input === undefined) {
2503+
return '';
2504+
}
2505+
else if (typeof input === 'string' || input instanceof String) {
2506+
return input;
2507+
}
2508+
return JSON.stringify(input);
2509+
}
2510+
exports.toCommandValue = toCommandValue;
2511+
//# sourceMappingURL=utils.js.map
2512+
2513+
/***/ }),
24902514
/* 83 */,
24912515
/* 84 */,
24922516
/* 85 */
@@ -3722,7 +3746,41 @@ module.exports = {
37223746
/* 99 */,
37233747
/* 100 */,
37243748
/* 101 */,
3725-
/* 102 */,
3749+
/* 102 */
3750+
/***/ (function(__unusedmodule, exports, __webpack_require__) {
3751+
3752+
"use strict";
3753+
3754+
// For internal use, subject to change.
3755+
var __importStar = (this && this.__importStar) || function (mod) {
3756+
if (mod && mod.__esModule) return mod;
3757+
var result = {};
3758+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
3759+
result["default"] = mod;
3760+
return result;
3761+
};
3762+
Object.defineProperty(exports, "__esModule", { value: true });
3763+
// We use any as a valid input type
3764+
/* eslint-disable @typescript-eslint/no-explicit-any */
3765+
const fs = __importStar(__webpack_require__(747));
3766+
const os = __importStar(__webpack_require__(87));
3767+
const utils_1 = __webpack_require__(82);
3768+
function issueCommand(command, message) {
3769+
const filePath = process.env[`GITHUB_${command}`];
3770+
if (!filePath) {
3771+
throw new Error(`Unable to find environment variable for file command ${command}`);
3772+
}
3773+
if (!fs.existsSync(filePath)) {
3774+
throw new Error(`Missing file at path: ${filePath}`);
3775+
}
3776+
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
3777+
encoding: 'utf8'
3778+
});
3779+
}
3780+
exports.issueCommand = issueCommand;
3781+
//# sourceMappingURL=file-command.js.map
3782+
3783+
/***/ }),
37263784
/* 103 */,
37273785
/* 104 */
37283786
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
@@ -22593,6 +22651,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
2259322651
};
2259422652
Object.defineProperty(exports, "__esModule", { value: true });
2259522653
const os = __importStar(__webpack_require__(87));
22654+
const utils_1 = __webpack_require__(82);
2259622655
/**
2259722656
* Commands
2259822657
*
@@ -22647,13 +22706,13 @@ class Command {
2264722706
}
2264822707
}
2264922708
function escapeData(s) {
22650-
return (s || '')
22709+
return utils_1.toCommandValue(s)
2265122710
.replace(/%/g, '%25')
2265222711
.replace(/\r/g, '%0D')
2265322712
.replace(/\n/g, '%0A');
2265422713
}
2265522714
function escapeProperty(s) {
22656-
return (s || '')
22715+
return utils_1.toCommandValue(s)
2265722716
.replace(/%/g, '%25')
2265822717
.replace(/\r/g, '%0D')
2265922718
.replace(/\n/g, '%0A')
@@ -26960,6 +27019,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
2696027019
};
2696127020
Object.defineProperty(exports, "__esModule", { value: true });
2696227021
const command_1 = __webpack_require__(431);
27022+
const file_command_1 = __webpack_require__(102);
27023+
const utils_1 = __webpack_require__(82);
2696327024
const os = __importStar(__webpack_require__(87));
2696427025
const path = __importStar(__webpack_require__(622));
2696527026
/**
@@ -26982,11 +27043,21 @@ var ExitCode;
2698227043
/**
2698327044
* Sets env variable for this action and future actions in the job
2698427045
* @param name the name of the variable to set
26985-
* @param val the value of the variable
27046+
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
2698627047
*/
27048+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2698727049
function exportVariable(name, val) {
26988-
process.env[name] = val;
26989-
command_1.issueCommand('set-env', { name }, val);
27050+
const convertedVal = utils_1.toCommandValue(val);
27051+
process.env[name] = convertedVal;
27052+
const filePath = process.env['GITHUB_ENV'] || '';
27053+
if (filePath) {
27054+
const delimiter = '_GitHubActionsFileCommandDelimeter_';
27055+
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
27056+
file_command_1.issueCommand('ENV', commandValue);
27057+
}
27058+
else {
27059+
command_1.issueCommand('set-env', { name }, convertedVal);
27060+
}
2699027061
}
2699127062
exports.exportVariable = exportVariable;
2699227063
/**
@@ -27002,7 +27073,13 @@ exports.setSecret = setSecret;
2700227073
* @param inputPath
2700327074
*/
2700427075
function addPath(inputPath) {
27005-
command_1.issueCommand('add-path', {}, inputPath);
27076+
const filePath = process.env['GITHUB_PATH'] || '';
27077+
if (filePath) {
27078+
file_command_1.issueCommand('PATH', inputPath);
27079+
}
27080+
else {
27081+
command_1.issueCommand('add-path', {}, inputPath);
27082+
}
2700627083
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
2700727084
}
2700827085
exports.addPath = addPath;
@@ -27025,12 +27102,22 @@ exports.getInput = getInput;
2702527102
* Sets the value of an output.
2702627103
*
2702727104
* @param name name of the output to set
27028-
* @param value value to store
27105+
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
2702927106
*/
27107+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2703027108
function setOutput(name, value) {
2703127109
command_1.issueCommand('set-output', { name }, value);
2703227110
}
2703327111
exports.setOutput = setOutput;
27112+
/**
27113+
* Enables or disables the echoing of commands into stdout for the rest of the step.
27114+
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
27115+
*
27116+
*/
27117+
function setCommandEcho(enabled) {
27118+
command_1.issue('echo', enabled ? 'on' : 'off');
27119+
}
27120+
exports.setCommandEcho = setCommandEcho;
2703427121
//-----------------------------------------------------------------------
2703527122
// Results
2703627123
//-----------------------------------------------------------------------
@@ -27064,18 +27151,18 @@ function debug(message) {
2706427151
exports.debug = debug;
2706527152
/**
2706627153
* Adds an error issue
27067-
* @param message error issue message
27154+
* @param message error issue message. Errors will be converted to string via toString()
2706827155
*/
2706927156
function error(message) {
27070-
command_1.issue('error', message);
27157+
command_1.issue('error', message instanceof Error ? message.toString() : message);
2707127158
}
2707227159
exports.error = error;
2707327160
/**
2707427161
* Adds an warning issue
27075-
* @param message warning issue message
27162+
* @param message warning issue message. Errors will be converted to string via toString()
2707627163
*/
2707727164
function warning(message) {
27078-
command_1.issue('warning', message);
27165+
command_1.issue('warning', message instanceof Error ? message.toString() : message);
2707927166
}
2708027167
exports.warning = warning;
2708127168
/**
@@ -27133,8 +27220,9 @@ exports.group = group;
2713327220
* Saves state for current action, the state can only be retrieved by this action's post job execution.
2713427221
*
2713527222
* @param name name of the state to store
27136-
* @param value value to store
27223+
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
2713727224
*/
27225+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2713827226
function saveState(name, value) {
2713927227
command_1.issueCommand('save-state', { name }, value);
2714027228
}

0 commit comments

Comments
 (0)