Skip to content

Commit 860fe50

Browse files
author
GitHub Actions
committed
chore: Update dist
1 parent 7cdd804 commit 860fe50

File tree

1 file changed

+84
-19
lines changed

1 file changed

+84
-19
lines changed

dist/index.js

Lines changed: 84 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10997,6 +10997,42 @@ module.exports = require("os");
1099710997

1099810998
/***/ }),
1099910999

11000+
/***/ 2102:
11001+
/***/ (function(__unusedmodule, exports, __webpack_require__) {
11002+
11003+
"use strict";
11004+
11005+
// For internal use, subject to change.
11006+
var __importStar = (this && this.__importStar) || function (mod) {
11007+
if (mod && mod.__esModule) return mod;
11008+
var result = {};
11009+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
11010+
result["default"] = mod;
11011+
return result;
11012+
};
11013+
Object.defineProperty(exports, "__esModule", { value: true });
11014+
// We use any as a valid input type
11015+
/* eslint-disable @typescript-eslint/no-explicit-any */
11016+
const fs = __importStar(__webpack_require__(5747));
11017+
const os = __importStar(__webpack_require__(2087));
11018+
const utils_1 = __webpack_require__(5082);
11019+
function issueCommand(command, message) {
11020+
const filePath = process.env[`GITHUB_${command}`];
11021+
if (!filePath) {
11022+
throw new Error(`Unable to find environment variable for file command ${command}`);
11023+
}
11024+
if (!fs.existsSync(filePath)) {
11025+
throw new Error(`Missing file at path: ${filePath}`);
11026+
}
11027+
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
11028+
encoding: 'utf8'
11029+
});
11030+
}
11031+
exports.issueCommand = issueCommand;
11032+
//# sourceMappingURL=file-command.js.map
11033+
11034+
/***/ }),
11035+
1100011036
/***/ 2106:
1100111037
/***/ (function(module, __unusedexports, __webpack_require__) {
1100211038

@@ -23950,6 +23986,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
2395023986
};
2395123987
Object.defineProperty(exports, "__esModule", { value: true });
2395223988
const os = __importStar(__webpack_require__(2087));
23989+
const utils_1 = __webpack_require__(5082);
2395323990
/**
2395423991
* Commands
2395523992
*
@@ -24003,28 +24040,14 @@ class Command {
2400324040
return cmdStr;
2400424041
}
2400524042
}
24006-
/**
24007-
* Sanitizes an input into a string so it can be passed into issueCommand safely
24008-
* @param input input to sanitize into a string
24009-
*/
24010-
function toCommandValue(input) {
24011-
if (input === null || input === undefined) {
24012-
return '';
24013-
}
24014-
else if (typeof input === 'string' || input instanceof String) {
24015-
return input;
24016-
}
24017-
return JSON.stringify(input);
24018-
}
24019-
exports.toCommandValue = toCommandValue;
2402024043
function escapeData(s) {
24021-
return toCommandValue(s)
24044+
return utils_1.toCommandValue(s)
2402224045
.replace(/%/g, '%25')
2402324046
.replace(/\r/g, '%0D')
2402424047
.replace(/\n/g, '%0A');
2402524048
}
2402624049
function escapeProperty(s) {
24027-
return toCommandValue(s)
24050+
return utils_1.toCommandValue(s)
2402824051
.replace(/%/g, '%25')
2402924052
.replace(/\r/g, '%0D')
2403024053
.replace(/\n/g, '%0A')
@@ -27025,6 +27048,32 @@ module.exports = {"pagination":{"ListActionExecutions":{"input_token":"nextToken
2702527048

2702627049
/***/ }),
2702727050

27051+
/***/ 5082:
27052+
/***/ (function(__unusedmodule, exports) {
27053+
27054+
"use strict";
27055+
27056+
// We use any as a valid input type
27057+
/* eslint-disable @typescript-eslint/no-explicit-any */
27058+
Object.defineProperty(exports, "__esModule", { value: true });
27059+
/**
27060+
* Sanitizes an input into a string so it can be passed into issueCommand safely
27061+
* @param input input to sanitize into a string
27062+
*/
27063+
function toCommandValue(input) {
27064+
if (input === null || input === undefined) {
27065+
return '';
27066+
}
27067+
else if (typeof input === 'string' || input instanceof String) {
27068+
return input;
27069+
}
27070+
return JSON.stringify(input);
27071+
}
27072+
exports.toCommandValue = toCommandValue;
27073+
//# sourceMappingURL=utils.js.map
27074+
27075+
/***/ }),
27076+
2702827077
/***/ 5089:
2702927078
/***/ (function(module) {
2703027079

@@ -30784,6 +30833,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
3078430833
};
3078530834
Object.defineProperty(exports, "__esModule", { value: true });
3078630835
const command_1 = __webpack_require__(4431);
30836+
const file_command_1 = __webpack_require__(2102);
30837+
const utils_1 = __webpack_require__(5082);
3078730838
const os = __importStar(__webpack_require__(2087));
3078830839
const path = __importStar(__webpack_require__(5622));
3078930840
/**
@@ -30810,9 +30861,17 @@ var ExitCode;
3081030861
*/
3081130862
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3081230863
function exportVariable(name, val) {
30813-
const convertedVal = command_1.toCommandValue(val);
30864+
const convertedVal = utils_1.toCommandValue(val);
3081430865
process.env[name] = convertedVal;
30815-
command_1.issueCommand('set-env', { name }, convertedVal);
30866+
const filePath = process.env['GITHUB_ENV'] || '';
30867+
if (filePath) {
30868+
const delimiter = '_GitHubActionsFileCommandDelimeter_';
30869+
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
30870+
file_command_1.issueCommand('ENV', commandValue);
30871+
}
30872+
else {
30873+
command_1.issueCommand('set-env', { name }, convertedVal);
30874+
}
3081630875
}
3081730876
exports.exportVariable = exportVariable;
3081830877
/**
@@ -30828,7 +30887,13 @@ exports.setSecret = setSecret;
3082830887
* @param inputPath
3082930888
*/
3083030889
function addPath(inputPath) {
30831-
command_1.issueCommand('add-path', {}, inputPath);
30890+
const filePath = process.env['GITHUB_PATH'] || '';
30891+
if (filePath) {
30892+
file_command_1.issueCommand('PATH', inputPath);
30893+
}
30894+
else {
30895+
command_1.issueCommand('add-path', {}, inputPath);
30896+
}
3083230897
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
3083330898
}
3083430899
exports.addPath = addPath;

0 commit comments

Comments
 (0)