@@ -649,6 +649,33 @@ module.exports = {"version":"2.0","metadata":{"apiVersion":"2014-06-30","endpoin
649
649
650
650
/***/ }),
651
651
652
+ /***/ 82:
653
+ /***/ (function(__unusedmodule, exports) {
654
+
655
+ "use strict";
656
+
657
+ // We use any as a valid input type
658
+ /* eslint-disable @typescript-eslint/no-explicit-any */
659
+ Object.defineProperty(exports, "__esModule", { value: true });
660
+ exports.toCommandValue = void 0;
661
+ /**
662
+ * Sanitizes an input into a string so it can be passed into issueCommand safely
663
+ * @param input input to sanitize into a string
664
+ */
665
+ function toCommandValue(input) {
666
+ if (input === null || input === undefined) {
667
+ return '';
668
+ }
669
+ else if (typeof input === 'string' || input instanceof String) {
670
+ return input;
671
+ }
672
+ return JSON.stringify(input);
673
+ }
674
+ exports.toCommandValue = toCommandValue;
675
+ //# sourceMappingURL=utils.js.map
676
+
677
+ /***/ }),
678
+
652
679
/***/ 86:
653
680
/***/ (function(module, __unusedexports, __webpack_require__) {
654
681
@@ -772,6 +799,55 @@ module.exports = require("os");
772
799
773
800
/***/ }),
774
801
802
+ /***/ 102:
803
+ /***/ (function(__unusedmodule, exports, __webpack_require__) {
804
+
805
+ "use strict";
806
+
807
+ // For internal use, subject to change.
808
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
809
+ if (k2 === undefined) k2 = k;
810
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
811
+ }) : (function(o, m, k, k2) {
812
+ if (k2 === undefined) k2 = k;
813
+ o[k2] = m[k];
814
+ }));
815
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
816
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
817
+ }) : function(o, v) {
818
+ o["default"] = v;
819
+ });
820
+ var __importStar = (this && this.__importStar) || function (mod) {
821
+ if (mod && mod.__esModule) return mod;
822
+ var result = {};
823
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
824
+ __setModuleDefault(result, mod);
825
+ return result;
826
+ };
827
+ Object.defineProperty(exports, "__esModule", { value: true });
828
+ exports.issueCommand = void 0;
829
+ // We use any as a valid input type
830
+ /* eslint-disable @typescript-eslint/no-explicit-any */
831
+ const fs = __importStar(__webpack_require__(747));
832
+ const os = __importStar(__webpack_require__(87));
833
+ const utils_1 = __webpack_require__(82);
834
+ function issueCommand(command, message) {
835
+ const filePath = process.env[`GITHUB_${command}`];
836
+ if (!filePath) {
837
+ throw new Error(`Unable to find environment variable for file command ${command}`);
838
+ }
839
+ if (!fs.existsSync(filePath)) {
840
+ throw new Error(`Missing file at path: ${filePath}`);
841
+ }
842
+ fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
843
+ encoding: 'utf8'
844
+ });
845
+ }
846
+ exports.issueCommand = issueCommand;
847
+ //# sourceMappingURL=file-command.js.map
848
+
849
+ /***/ }),
850
+
775
851
/***/ 103:
776
852
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
777
853
@@ -4516,15 +4592,29 @@ AWS.RemoteCredentials = AWS.util.inherit(AWS.Credentials, {
4516
4592
4517
4593
"use strict";
4518
4594
4595
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4596
+ if (k2 === undefined) k2 = k;
4597
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4598
+ }) : (function(o, m, k, k2) {
4599
+ if (k2 === undefined) k2 = k;
4600
+ o[k2] = m[k];
4601
+ }));
4602
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
4603
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
4604
+ }) : function(o, v) {
4605
+ o["default"] = v;
4606
+ });
4519
4607
var __importStar = (this && this.__importStar) || function (mod) {
4520
4608
if (mod && mod.__esModule) return mod;
4521
4609
var result = {};
4522
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k] ;
4523
- result["default"] = mod;
4610
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding( result, mod, k) ;
4611
+ __setModuleDefault( result, mod) ;
4524
4612
return result;
4525
4613
};
4526
4614
Object.defineProperty(exports, "__esModule", { value: true });
4615
+ exports.issue = exports.issueCommand = void 0;
4527
4616
const os = __importStar(__webpack_require__(87));
4617
+ const utils_1 = __webpack_require__(82);
4528
4618
/**
4529
4619
* Commands
4530
4620
*
@@ -4578,28 +4668,14 @@ class Command {
4578
4668
return cmdStr;
4579
4669
}
4580
4670
}
4581
- /**
4582
- * Sanitizes an input into a string so it can be passed into issueCommand safely
4583
- * @param input input to sanitize into a string
4584
- */
4585
- function toCommandValue(input) {
4586
- if (input === null || input === undefined) {
4587
- return '';
4588
- }
4589
- else if (typeof input === 'string' || input instanceof String) {
4590
- return input;
4591
- }
4592
- return JSON.stringify(input);
4593
- }
4594
- exports.toCommandValue = toCommandValue;
4595
4671
function escapeData(s) {
4596
- return toCommandValue(s)
4672
+ return utils_1. toCommandValue(s)
4597
4673
.replace(/%/g, '%25')
4598
4674
.replace(/\r/g, '%0D')
4599
4675
.replace(/\n/g, '%0A');
4600
4676
}
4601
4677
function escapeProperty(s) {
4602
- return toCommandValue(s)
4678
+ return utils_1. toCommandValue(s)
4603
4679
.replace(/%/g, '%25')
4604
4680
.replace(/\r/g, '%0D')
4605
4681
.replace(/\n/g, '%0A')
@@ -5898,6 +5974,25 @@ AWS.util.mixin(AWS.Request, AWS.SequentialExecutor);
5898
5974
5899
5975
"use strict";
5900
5976
5977
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5978
+ if (k2 === undefined) k2 = k;
5979
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5980
+ }) : (function(o, m, k, k2) {
5981
+ if (k2 === undefined) k2 = k;
5982
+ o[k2] = m[k];
5983
+ }));
5984
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
5985
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
5986
+ }) : function(o, v) {
5987
+ o["default"] = v;
5988
+ });
5989
+ var __importStar = (this && this.__importStar) || function (mod) {
5990
+ if (mod && mod.__esModule) return mod;
5991
+ var result = {};
5992
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
5993
+ __setModuleDefault(result, mod);
5994
+ return result;
5995
+ };
5901
5996
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5902
5997
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5903
5998
return new (P || (P = Promise))(function (resolve, reject) {
@@ -5907,15 +6002,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
5907
6002
step((generator = generator.apply(thisArg, _arguments || [])).next());
5908
6003
});
5909
6004
};
5910
- var __importStar = (this && this.__importStar) || function (mod) {
5911
- if (mod && mod.__esModule) return mod;
5912
- var result = {};
5913
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
5914
- result["default"] = mod;
5915
- return result;
5916
- };
5917
6005
Object.defineProperty(exports, "__esModule", { value: true });
6006
+ exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
5918
6007
const command_1 = __webpack_require__(431);
6008
+ const file_command_1 = __webpack_require__(102);
6009
+ const utils_1 = __webpack_require__(82);
5919
6010
const os = __importStar(__webpack_require__(87));
5920
6011
const path = __importStar(__webpack_require__(622));
5921
6012
/**
@@ -5942,9 +6033,17 @@ var ExitCode;
5942
6033
*/
5943
6034
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5944
6035
function exportVariable(name, val) {
5945
- const convertedVal = command_1 .toCommandValue(val);
6036
+ const convertedVal = utils_1 .toCommandValue(val);
5946
6037
process.env[name] = convertedVal;
5947
- command_1.issueCommand('set-env', { name }, convertedVal);
6038
+ const filePath = process.env['GITHUB_ENV'] || '';
6039
+ if (filePath) {
6040
+ const delimiter = '_GitHubActionsFileCommandDelimeter_';
6041
+ const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
6042
+ file_command_1.issueCommand('ENV', commandValue);
6043
+ }
6044
+ else {
6045
+ command_1.issueCommand('set-env', { name }, convertedVal);
6046
+ }
5948
6047
}
5949
6048
exports.exportVariable = exportVariable;
5950
6049
/**
@@ -5960,12 +6059,20 @@ exports.setSecret = setSecret;
5960
6059
* @param inputPath
5961
6060
*/
5962
6061
function addPath(inputPath) {
5963
- command_1.issueCommand('add-path', {}, inputPath);
6062
+ const filePath = process.env['GITHUB_PATH'] || '';
6063
+ if (filePath) {
6064
+ file_command_1.issueCommand('PATH', inputPath);
6065
+ }
6066
+ else {
6067
+ command_1.issueCommand('add-path', {}, inputPath);
6068
+ }
5964
6069
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
5965
6070
}
5966
6071
exports.addPath = addPath;
5967
6072
/**
5968
- * Gets the value of an input. The value is also trimmed.
6073
+ * Gets the value of an input.
6074
+ * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
6075
+ * Returns an empty string if the value is not defined.
5969
6076
*
5970
6077
* @param name name of the input to get
5971
6078
* @param options optional. See InputOptions.
@@ -5976,9 +6083,34 @@ function getInput(name, options) {
5976
6083
if (options && options.required && !val) {
5977
6084
throw new Error(`Input required and not supplied: ${name}`);
5978
6085
}
6086
+ if (options && options.trimWhitespace === false) {
6087
+ return val;
6088
+ }
5979
6089
return val.trim();
5980
6090
}
5981
6091
exports.getInput = getInput;
6092
+ /**
6093
+ * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
6094
+ * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
6095
+ * The return value is also in boolean type.
6096
+ * ref: https://yaml.org/spec/1.2/spec.html#id2804923
6097
+ *
6098
+ * @param name name of the input to get
6099
+ * @param options optional. See InputOptions.
6100
+ * @returns boolean
6101
+ */
6102
+ function getBooleanInput(name, options) {
6103
+ const trueValue = ['true', 'True', 'TRUE'];
6104
+ const falseValue = ['false', 'False', 'FALSE'];
6105
+ const val = getInput(name, options);
6106
+ if (trueValue.includes(val))
6107
+ return true;
6108
+ if (falseValue.includes(val))
6109
+ return false;
6110
+ throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
6111
+ `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
6112
+ }
6113
+ exports.getBooleanInput = getBooleanInput;
5982
6114
/**
5983
6115
* Sets the value of an output.
5984
6116
*
@@ -5987,6 +6119,7 @@ exports.getInput = getInput;
5987
6119
*/
5988
6120
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5989
6121
function setOutput(name, value) {
6122
+ process.stdout.write(os.EOL);
5990
6123
command_1.issueCommand('set-output', { name }, value);
5991
6124
}
5992
6125
exports.setOutput = setOutput;
@@ -20835,4 +20968,4 @@ module.exports = {
20835
20968
20836
20969
/***/ })
20837
20970
20838
- /******/ });
20971
+ /******/ });
0 commit comments