@@ -10997,6 +10997,42 @@ module.exports = require("os");
10997
10997
10998
10998
/***/ }),
10999
10999
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
+
11000
11036
/***/ 2106:
11001
11037
/***/ (function(module, __unusedexports, __webpack_require__) {
11002
11038
@@ -23950,6 +23986,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23950
23986
};
23951
23987
Object.defineProperty(exports, "__esModule", { value: true });
23952
23988
const os = __importStar(__webpack_require__(2087));
23989
+ const utils_1 = __webpack_require__(5082);
23953
23990
/**
23954
23991
* Commands
23955
23992
*
@@ -24003,28 +24040,14 @@ class Command {
24003
24040
return cmdStr;
24004
24041
}
24005
24042
}
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;
24020
24043
function escapeData(s) {
24021
- return toCommandValue(s)
24044
+ return utils_1. toCommandValue(s)
24022
24045
.replace(/%/g, '%25')
24023
24046
.replace(/\r/g, '%0D')
24024
24047
.replace(/\n/g, '%0A');
24025
24048
}
24026
24049
function escapeProperty(s) {
24027
- return toCommandValue(s)
24050
+ return utils_1. toCommandValue(s)
24028
24051
.replace(/%/g, '%25')
24029
24052
.replace(/\r/g, '%0D')
24030
24053
.replace(/\n/g, '%0A')
@@ -27025,6 +27048,32 @@ module.exports = {"pagination":{"ListActionExecutions":{"input_token":"nextToken
27025
27048
27026
27049
/***/ }),
27027
27050
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
+
27028
27077
/***/ 5089:
27029
27078
/***/ (function(module) {
27030
27079
@@ -30784,6 +30833,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
30784
30833
};
30785
30834
Object.defineProperty(exports, "__esModule", { value: true });
30786
30835
const command_1 = __webpack_require__(4431);
30836
+ const file_command_1 = __webpack_require__(2102);
30837
+ const utils_1 = __webpack_require__(5082);
30787
30838
const os = __importStar(__webpack_require__(2087));
30788
30839
const path = __importStar(__webpack_require__(5622));
30789
30840
/**
@@ -30810,9 +30861,17 @@ var ExitCode;
30810
30861
*/
30811
30862
// eslint-disable-next-line @typescript-eslint/no-explicit-any
30812
30863
function exportVariable(name, val) {
30813
- const convertedVal = command_1 .toCommandValue(val);
30864
+ const convertedVal = utils_1 .toCommandValue(val);
30814
30865
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
+ }
30816
30875
}
30817
30876
exports.exportVariable = exportVariable;
30818
30877
/**
@@ -30828,7 +30887,13 @@ exports.setSecret = setSecret;
30828
30887
* @param inputPath
30829
30888
*/
30830
30889
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
+ }
30832
30897
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
30833
30898
}
30834
30899
exports.addPath = addPath;
0 commit comments