From c3caa3a6ceec65b04efba81cb7cfe73f383a5d53 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 24 Nov 2022 00:14:04 +0900 Subject: [PATCH 1/6] Update action runime to node v16 (#243) Bumping runtime from node 12 to node 16 within the action container. --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c42fa2d3..75a433bb 100644 --- a/action.yml +++ b/action.yml @@ -50,5 +50,5 @@ outputs: response: # id of output description: "response from lambda invocation" runs: - using: "node12" + using: "node16" main: "dist/index.js" From d81c1d9b0db6f2a8300f9c539656d039ddb1efdf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 10:14:19 -0500 Subject: [PATCH 2/6] Update Node.js to v16.17.0 (#240) * Update Node.js to v16.17.0 * Changes found on Workflow Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Github Workflow --- .nvmrc | 2 +- dist/index.js | 2119 ++++++++++++++++++++++++++++++++++++++++++--- package-lock.json | 14 +- package.json | 2 +- 4 files changed, 2028 insertions(+), 109 deletions(-) diff --git a/.nvmrc b/.nvmrc index 431076a9..2a4e4ab8 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.16.0 +16.17.0 diff --git a/dist/index.js b/dist/index.js index 631f733e..649104e9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7830,71 +7830,138 @@ var require_core = __commonJS({ }, }); -// node_modules/aws-sdk/node_modules/uuid/lib/rng.js +// node_modules/uuid/dist/rng.js var require_rng = __commonJS({ - 'node_modules/aws-sdk/node_modules/uuid/lib/rng.js'(exports, module2) { - var crypto = require('crypto'); - module2.exports = function nodeRNG() { - return crypto.randomBytes(16); - }; + 'node_modules/uuid/dist/rng.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = rng; + var _crypto = _interopRequireDefault(require('crypto')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var rnds8Pool = new Uint8Array(256); + var poolPtr = rnds8Pool.length; + function rng() { + if (poolPtr > rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); + poolPtr = 0; + } + return rnds8Pool.slice(poolPtr, (poolPtr += 16)); + } + }, +}); + +// node_modules/uuid/dist/regex.js +var require_regex = __commonJS({ + 'node_modules/uuid/dist/regex.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _default = + /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; + exports.default = _default; + }, +}); + +// node_modules/uuid/dist/validate.js +var require_validate = __commonJS({ + 'node_modules/uuid/dist/validate.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _regex = _interopRequireDefault(require_regex()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function validate(uuid) { + return typeof uuid === 'string' && _regex.default.test(uuid); + } + var _default = validate; + exports.default = _default; }, }); -// node_modules/aws-sdk/node_modules/uuid/lib/bytesToUuid.js -var require_bytesToUuid = __commonJS({ - 'node_modules/aws-sdk/node_modules/uuid/lib/bytesToUuid.js'(exports, module2) { +// node_modules/uuid/dist/stringify.js +var require_stringify = __commonJS({ + 'node_modules/uuid/dist/stringify.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _validate = _interopRequireDefault(require_validate()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } var byteToHex = []; - for (i = 0; i < 256; ++i) { - byteToHex[i] = (i + 256).toString(16).substr(1); + for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 256).toString(16).substr(1)); } - var i; - function bytesToUuid(buf, offset) { - var i2 = offset || 0; - var bth = byteToHex; - return [ - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - '-', - bth[buf[i2++]], - bth[buf[i2++]], - '-', - bth[buf[i2++]], - bth[buf[i2++]], - '-', - bth[buf[i2++]], - bth[buf[i2++]], - '-', - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - bth[buf[i2++]], - ].join(''); + function stringify(arr, offset = 0) { + const uuid = ( + byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]] + ).toLowerCase(); + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; } - module2.exports = bytesToUuid; + var _default = stringify; + exports.default = _default; }, }); -// node_modules/aws-sdk/node_modules/uuid/v1.js +// node_modules/uuid/dist/v1.js var require_v1 = __commonJS({ - 'node_modules/aws-sdk/node_modules/uuid/v1.js'(exports, module2) { - var rng = require_rng(); - var bytesToUuid = require_bytesToUuid(); + 'node_modules/uuid/dist/v1.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _rng = _interopRequireDefault(require_rng()); + var _stringify = _interopRequireDefault(require_stringify()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } var _nodeId; var _clockseq; var _lastMSecs = 0; var _lastNSecs = 0; function v1(options, buf, offset) { - var i = (buf && offset) || 0; - var b = buf || []; + let i = (buf && offset) || 0; + const b = buf || new Array(16); options = options || {}; - var node = options.node || _nodeId; - var clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq; if (node == null || clockseq == null) { - var seedBytes = rng(); + const seedBytes = options.random || (options.rng || _rng.default)(); if (node == null) { node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; } @@ -7902,9 +7969,9 @@ var require_v1 = __commonJS({ clockseq = _clockseq = ((seedBytes[6] << 8) | seedBytes[7]) & 16383; } } - var msecs = options.msecs !== void 0 ? options.msecs : new Date().getTime(); - var nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1; - var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; + let msecs = options.msecs !== void 0 ? options.msecs : Date.now(); + let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1; + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; if (dt < 0 && options.clockseq === void 0) { clockseq = (clockseq + 1) & 16383; } @@ -7918,62 +7985,360 @@ var require_v1 = __commonJS({ _lastNSecs = nsecs; _clockseq = clockseq; msecs += 122192928e5; - var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; + const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; b[i++] = (tl >>> 24) & 255; b[i++] = (tl >>> 16) & 255; b[i++] = (tl >>> 8) & 255; b[i++] = tl & 255; - var tmh = ((msecs / 4294967296) * 1e4) & 268435455; + const tmh = ((msecs / 4294967296) * 1e4) & 268435455; b[i++] = (tmh >>> 8) & 255; b[i++] = tmh & 255; b[i++] = ((tmh >>> 24) & 15) | 16; b[i++] = (tmh >>> 16) & 255; b[i++] = (clockseq >>> 8) | 128; b[i++] = clockseq & 255; - for (var n = 0; n < 6; ++n) { + for (let n = 0; n < 6; ++n) { b[i + n] = node[n]; } - return buf ? buf : bytesToUuid(b); + return buf || (0, _stringify.default)(b); + } + var _default = v1; + exports.default = _default; + }, +}); + +// node_modules/uuid/dist/parse.js +var require_parse = __commonJS({ + 'node_modules/uuid/dist/parse.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _validate = _interopRequireDefault(require_validate()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + const arr = new Uint8Array(16); + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = (v >>> 16) & 255; + arr[2] = (v >>> 8) & 255; + arr[3] = v & 255; + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 255; + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 255; + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 255; + arr[10] = ((v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776) & 255; + arr[11] = (v / 4294967296) & 255; + arr[12] = (v >>> 24) & 255; + arr[13] = (v >>> 16) & 255; + arr[14] = (v >>> 8) & 255; + arr[15] = v & 255; + return arr; + } + var _default = parse; + exports.default = _default; + }, +}); + +// node_modules/uuid/dist/v35.js +var require_v35 = __commonJS({ + 'node_modules/uuid/dist/v35.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = _default; + exports.URL = exports.DNS = void 0; + var _stringify = _interopRequireDefault(require_stringify()); + var _parse = _interopRequireDefault(require_parse()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = []; + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + return bytes; + } + var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; + exports.DNS = DNS; + var URL2 = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; + exports.URL = URL2; + function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); + } + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = (bytes[6] & 15) | version; + bytes[8] = (bytes[8] & 63) | 128; + if (buf) { + offset = offset || 0; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return (0, _stringify.default)(bytes); + } + try { + generateUUID.name = name; + } catch (err) {} + generateUUID.DNS = DNS; + generateUUID.URL = URL2; + return generateUUID; + } + }, +}); + +// node_modules/uuid/dist/md5.js +var require_md5 = __commonJS({ + 'node_modules/uuid/dist/md5.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _crypto = _interopRequireDefault(require('crypto')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return _crypto.default.createHash('md5').update(bytes).digest(); + } + var _default = md5; + exports.default = _default; + }, +}); + +// node_modules/uuid/dist/v3.js +var require_v32 = __commonJS({ + 'node_modules/uuid/dist/v3.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _v = _interopRequireDefault(require_v35()); + var _md = _interopRequireDefault(require_md5()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; } - module2.exports = v1; + var v3 = (0, _v.default)('v3', 48, _md.default); + var _default = v3; + exports.default = _default; }, }); -// node_modules/aws-sdk/node_modules/uuid/v4.js +// node_modules/uuid/dist/v4.js var require_v42 = __commonJS({ - 'node_modules/aws-sdk/node_modules/uuid/v4.js'(exports, module2) { - var rng = require_rng(); - var bytesToUuid = require_bytesToUuid(); + 'node_modules/uuid/dist/v4.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _rng = _interopRequireDefault(require_rng()); + var _stringify = _interopRequireDefault(require_stringify()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } function v4(options, buf, offset) { - var i = (buf && offset) || 0; - if (typeof options == 'string') { - buf = options === 'binary' ? new Array(16) : null; - options = null; - } options = options || {}; - var rnds = options.random || (options.rng || rng)(); + const rnds = options.random || (options.rng || _rng.default)(); rnds[6] = (rnds[6] & 15) | 64; rnds[8] = (rnds[8] & 63) | 128; if (buf) { - for (var ii = 0; ii < 16; ++ii) { - buf[i + ii] = rnds[ii]; + offset = offset || 0; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; } + return buf; + } + return (0, _stringify.default)(rnds); + } + var _default = v4; + exports.default = _default; + }, +}); + +// node_modules/uuid/dist/sha1.js +var require_sha1 = __commonJS({ + 'node_modules/uuid/dist/sha1.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _crypto = _interopRequireDefault(require('crypto')); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return _crypto.default.createHash('sha1').update(bytes).digest(); + } + var _default = sha1; + exports.default = _default; + }, +}); + +// node_modules/uuid/dist/v5.js +var require_v5 = __commonJS({ + 'node_modules/uuid/dist/v5.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _v = _interopRequireDefault(require_v35()); + var _sha = _interopRequireDefault(require_sha1()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + var v5 = (0, _v.default)('v5', 80, _sha.default); + var _default = v5; + exports.default = _default; + }, +}); + +// node_modules/uuid/dist/nil.js +var require_nil = __commonJS({ + 'node_modules/uuid/dist/nil.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _default = '00000000-0000-0000-0000-000000000000'; + exports.default = _default; + }, +}); + +// node_modules/uuid/dist/version.js +var require_version = __commonJS({ + 'node_modules/uuid/dist/version.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + exports.default = void 0; + var _validate = _interopRequireDefault(require_validate()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); } - return buf || bytesToUuid(rnds); + return parseInt(uuid.substr(14, 1), 16); } - module2.exports = v4; + var _default = version; + exports.default = _default; }, }); -// node_modules/aws-sdk/node_modules/uuid/index.js -var require_uuid = __commonJS({ - 'node_modules/aws-sdk/node_modules/uuid/index.js'(exports, module2) { - var v1 = require_v1(); - var v4 = require_v42(); - var uuid = v4; - uuid.v1 = v1; - uuid.v4 = v4; - module2.exports = uuid; +// node_modules/uuid/dist/index.js +var require_dist = __commonJS({ + 'node_modules/uuid/dist/index.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { + value: true, + }); + Object.defineProperty(exports, 'v1', { + enumerable: true, + get: function () { + return _v.default; + }, + }); + Object.defineProperty(exports, 'v3', { + enumerable: true, + get: function () { + return _v2.default; + }, + }); + Object.defineProperty(exports, 'v4', { + enumerable: true, + get: function () { + return _v3.default; + }, + }); + Object.defineProperty(exports, 'v5', { + enumerable: true, + get: function () { + return _v4.default; + }, + }); + Object.defineProperty(exports, 'NIL', { + enumerable: true, + get: function () { + return _nil.default; + }, + }); + Object.defineProperty(exports, 'version', { + enumerable: true, + get: function () { + return _version.default; + }, + }); + Object.defineProperty(exports, 'validate', { + enumerable: true, + get: function () { + return _validate.default; + }, + }); + Object.defineProperty(exports, 'stringify', { + enumerable: true, + get: function () { + return _stringify.default; + }, + }); + Object.defineProperty(exports, 'parse', { + enumerable: true, + get: function () { + return _parse.default; + }, + }); + var _v = _interopRequireDefault(require_v1()); + var _v2 = _interopRequireDefault(require_v32()); + var _v3 = _interopRequireDefault(require_v42()); + var _v4 = _interopRequireDefault(require_v5()); + var _nil = _interopRequireDefault(require_nil()); + var _version = _interopRequireDefault(require_version()); + var _validate = _interopRequireDefault(require_validate()); + var _stringify = _interopRequireDefault(require_stringify()); + var _parse = _interopRequireDefault(require_parse()); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } }, }); @@ -8676,7 +9041,7 @@ var require_util = __commonJS({ }, uuid: { v4: function uuidV4() { - return require_uuid().v4(); + return require_dist().v4(); }, }, convertPayloadToString: function convertPayloadToString(resp) { @@ -19677,6 +20042,7 @@ var require_utils = __commonJS({ 'node_modules/@actions/core/lib/utils.js'(exports) { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); + exports.toCommandProperties = exports.toCommandValue = void 0; function toCommandValue(input) { if (input === null || input === void 0) { return ''; @@ -19686,6 +20052,20 @@ var require_utils = __commonJS({ return JSON.stringify(input); } exports.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; + } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn, + }; + } + exports.toCommandProperties = toCommandProperties; }, }); @@ -19693,18 +20073,44 @@ var require_utils = __commonJS({ var require_command = __commonJS({ 'node_modules/@actions/core/lib/command.js'(exports) { 'use strict'; + var __createBinding = + (exports && exports.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (exports && exports.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, 'default', { enumerable: true, value: v }); + } + : function (o, v) { + o['default'] = v; + }); var __importStar = (exports && exports.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { - for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + for (var k in mod) if (k !== 'default' && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); } - result['default'] = mod; + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, '__esModule', { value: true }); + exports.issue = exports.issueCommand = void 0; var os = __importStar(require('os')); var utils_1 = require_utils(); function issueCommand(command, properties, message) { @@ -19768,18 +20174,44 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ 'node_modules/@actions/core/lib/file-command.js'(exports) { 'use strict'; + var __createBinding = + (exports && exports.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (exports && exports.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, 'default', { enumerable: true, value: v }); + } + : function (o, v) { + o['default'] = v; + }); var __importStar = (exports && exports.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { - for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + for (var k in mod) if (k !== 'default' && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); } - result['default'] = mod; + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, '__esModule', { value: true }); + exports.issueCommand = void 0; var fs = __importStar(require('fs')); var os = __importStar(require('os')); var utils_1 = require_utils(); @@ -19799,10 +20231,335 @@ var require_file_command = __commonJS({ }, }); -// node_modules/@actions/core/lib/core.js -var require_core2 = __commonJS({ - 'node_modules/@actions/core/lib/core.js'(exports) { +// node_modules/@actions/http-client/lib/proxy.js +var require_proxy = __commonJS({ + 'node_modules/@actions/http-client/lib/proxy.js'(exports) { + 'use strict'; + Object.defineProperty(exports, '__esModule', { value: true }); + exports.checkBypass = exports.getProxyUrl = void 0; + function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === 'https:'; + if (checkBypass(reqUrl)) { + return void 0; + } + const proxyVar = (() => { + if (usingSsl) { + return process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } else { + return process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + })(); + if (proxyVar) { + return new URL(proxyVar); + } else { + return void 0; + } + } + exports.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; + } + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === 'http:') { + reqPort = 80; + } else if (reqUrl.protocol === 'https:') { + reqPort = 443; + } + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + for (const upperNoProxyItem of noProxy + .split(',') + .map((x) => x.trim().toUpperCase()) + .filter((x) => x)) { + if (upperReqHosts.some((x) => x === upperNoProxyItem)) { + return true; + } + } + return false; + } + exports.checkBypass = checkBypass; + }, +}); + +// node_modules/tunnel/lib/tunnel.js +var require_tunnel = __commonJS({ + 'node_modules/tunnel/lib/tunnel.js'(exports) { + 'use strict'; + var net = require('net'); + var tls = require('tls'); + var http = require('http'); + var https = require('https'); + var events = require('events'); + var assert = require('assert'); + var util = require('util'); + exports.httpOverHttp = httpOverHttp; + exports.httpsOverHttp = httpsOverHttp; + exports.httpOverHttps = httpOverHttps; + exports.httpsOverHttps = httpsOverHttps; + function httpOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + return agent; + } + function httpsOverHttp(options) { + var agent = new TunnelingAgent(options); + agent.request = http.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; + } + function httpOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + return agent; + } + function httpsOverHttps(options) { + var agent = new TunnelingAgent(options); + agent.request = https.request; + agent.createSocket = createSecureSocket; + agent.defaultPort = 443; + return agent; + } + function TunnelingAgent(options) { + var self = this; + self.options = options || {}; + self.proxyOptions = self.options.proxy || {}; + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; + self.requests = []; + self.sockets = []; + self.on('free', function onFree(socket, host, port, localAddress) { + var options2 = toOptions(host, port, localAddress); + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i]; + if (pending.host === options2.host && pending.port === options2.port) { + self.requests.splice(i, 1); + pending.request.onSocket(socket); + return; + } + } + socket.destroy(); + self.removeSocket(socket); + }); + } + util.inherits(TunnelingAgent, events.EventEmitter); + TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { + var self = this; + var options = mergeOptions({ request: req }, self.options, toOptions(host, port, localAddress)); + if (self.sockets.length >= this.maxSockets) { + self.requests.push(options); + return; + } + self.createSocket(options, function (socket) { + socket.on('free', onFree); + socket.on('close', onCloseOrRemove); + socket.on('agentRemove', onCloseOrRemove); + req.onSocket(socket); + function onFree() { + self.emit('free', socket, options); + } + function onCloseOrRemove(err) { + self.removeSocket(socket); + socket.removeListener('free', onFree); + socket.removeListener('close', onCloseOrRemove); + socket.removeListener('agentRemove', onCloseOrRemove); + } + }); + }; + TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this; + var placeholder = {}; + self.sockets.push(placeholder); + var connectOptions = mergeOptions({}, self.proxyOptions, { + method: 'CONNECT', + path: options.host + ':' + options.port, + agent: false, + headers: { + host: options.host + ':' + options.port, + }, + }); + if (options.localAddress) { + connectOptions.localAddress = options.localAddress; + } + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {}; + connectOptions.headers['Proxy-Authorization'] = + 'Basic ' + new Buffer(connectOptions.proxyAuth).toString('base64'); + } + debug('making CONNECT request'); + var connectReq = self.request(connectOptions); + connectReq.useChunkedEncodingByDefault = false; + connectReq.once('response', onResponse); + connectReq.once('upgrade', onUpgrade); + connectReq.once('connect', onConnect); + connectReq.once('error', onError); + connectReq.end(); + function onResponse(res) { + res.upgrade = true; + } + function onUpgrade(res, socket, head) { + process.nextTick(function () { + onConnect(res, socket, head); + }); + } + function onConnect(res, socket, head) { + connectReq.removeAllListeners(); + socket.removeAllListeners(); + if (res.statusCode !== 200) { + debug('tunneling socket could not be established, statusCode=%d', res.statusCode); + socket.destroy(); + var error = new Error('tunneling socket could not be established, statusCode=' + res.statusCode); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + if (head.length > 0) { + debug('got illegal response body from proxy'); + socket.destroy(); + var error = new Error('got illegal response body from proxy'); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + return; + } + debug('tunneling connection has established'); + self.sockets[self.sockets.indexOf(placeholder)] = socket; + return cb(socket); + } + function onError(cause) { + connectReq.removeAllListeners(); + debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack); + var error = new Error('tunneling socket could not be established, cause=' + cause.message); + error.code = 'ECONNRESET'; + options.request.emit('error', error); + self.removeSocket(placeholder); + } + }; + TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket); + if (pos === -1) { + return; + } + this.sockets.splice(pos, 1); + var pending = this.requests.shift(); + if (pending) { + this.createSocket(pending, function (socket2) { + pending.request.onSocket(socket2); + }); + } + }; + function createSecureSocket(options, cb) { + var self = this; + TunnelingAgent.prototype.createSocket.call(self, options, function (socket) { + var hostHeader = options.request.getHeader('host'); + var tlsOptions = mergeOptions({}, self.options, { + socket, + servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host, + }); + var secureSocket = tls.connect(0, tlsOptions); + self.sockets[self.sockets.indexOf(socket)] = secureSocket; + cb(secureSocket); + }); + } + function toOptions(host, port, localAddress) { + if (typeof host === 'string') { + return { + host, + port, + localAddress, + }; + } + return host; + } + function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i]; + if (typeof overrides === 'object') { + var keys = Object.keys(overrides); + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j]; + if (overrides[k] !== void 0) { + target[k] = overrides[k]; + } + } + } + } + return target; + } + var debug; + if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments); + if (typeof args[0] === 'string') { + args[0] = 'TUNNEL: ' + args[0]; + } else { + args.unshift('TUNNEL:'); + } + console.error.apply(console, args); + }; + } else { + debug = function () {}; + } + exports.debug = debug; + }, +}); + +// node_modules/tunnel/index.js +var require_tunnel2 = __commonJS({ + 'node_modules/tunnel/index.js'(exports, module2) { + module2.exports = require_tunnel(); + }, +}); + +// node_modules/@actions/http-client/lib/index.js +var require_lib2 = __commonJS({ + 'node_modules/@actions/http-client/lib/index.js'(exports) { 'use strict'; + var __createBinding = + (exports && exports.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (exports && exports.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, 'default', { enumerable: true, value: v }); + } + : function (o, v) { + o['default'] = v; + }); + var __importStar = + (exports && exports.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== 'default' && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; var __awaiter = (exports && exports.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -19834,23 +20591,1103 @@ var require_core2 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importStar = - (exports && exports.__importStar) || - function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - } - result['default'] = mod; + Object.defineProperty(exports, '__esModule', { value: true }); + exports.HttpClient = + exports.isHttps = + exports.HttpClientResponse = + exports.HttpClientError = + exports.getProxyUrl = + exports.MediaTypes = + exports.Headers = + exports.HttpCodes = + void 0; + var http = __importStar(require('http')); + var https = __importStar(require('https')); + var pm = __importStar(require_proxy()); + var tunnel = __importStar(require_tunnel2()); + var HttpCodes; + (function (HttpCodes2) { + HttpCodes2[(HttpCodes2['OK'] = 200)] = 'OK'; + HttpCodes2[(HttpCodes2['MultipleChoices'] = 300)] = 'MultipleChoices'; + HttpCodes2[(HttpCodes2['MovedPermanently'] = 301)] = 'MovedPermanently'; + HttpCodes2[(HttpCodes2['ResourceMoved'] = 302)] = 'ResourceMoved'; + HttpCodes2[(HttpCodes2['SeeOther'] = 303)] = 'SeeOther'; + HttpCodes2[(HttpCodes2['NotModified'] = 304)] = 'NotModified'; + HttpCodes2[(HttpCodes2['UseProxy'] = 305)] = 'UseProxy'; + HttpCodes2[(HttpCodes2['SwitchProxy'] = 306)] = 'SwitchProxy'; + HttpCodes2[(HttpCodes2['TemporaryRedirect'] = 307)] = 'TemporaryRedirect'; + HttpCodes2[(HttpCodes2['PermanentRedirect'] = 308)] = 'PermanentRedirect'; + HttpCodes2[(HttpCodes2['BadRequest'] = 400)] = 'BadRequest'; + HttpCodes2[(HttpCodes2['Unauthorized'] = 401)] = 'Unauthorized'; + HttpCodes2[(HttpCodes2['PaymentRequired'] = 402)] = 'PaymentRequired'; + HttpCodes2[(HttpCodes2['Forbidden'] = 403)] = 'Forbidden'; + HttpCodes2[(HttpCodes2['NotFound'] = 404)] = 'NotFound'; + HttpCodes2[(HttpCodes2['MethodNotAllowed'] = 405)] = 'MethodNotAllowed'; + HttpCodes2[(HttpCodes2['NotAcceptable'] = 406)] = 'NotAcceptable'; + HttpCodes2[(HttpCodes2['ProxyAuthenticationRequired'] = 407)] = 'ProxyAuthenticationRequired'; + HttpCodes2[(HttpCodes2['RequestTimeout'] = 408)] = 'RequestTimeout'; + HttpCodes2[(HttpCodes2['Conflict'] = 409)] = 'Conflict'; + HttpCodes2[(HttpCodes2['Gone'] = 410)] = 'Gone'; + HttpCodes2[(HttpCodes2['TooManyRequests'] = 429)] = 'TooManyRequests'; + HttpCodes2[(HttpCodes2['InternalServerError'] = 500)] = 'InternalServerError'; + HttpCodes2[(HttpCodes2['NotImplemented'] = 501)] = 'NotImplemented'; + HttpCodes2[(HttpCodes2['BadGateway'] = 502)] = 'BadGateway'; + HttpCodes2[(HttpCodes2['ServiceUnavailable'] = 503)] = 'ServiceUnavailable'; + HttpCodes2[(HttpCodes2['GatewayTimeout'] = 504)] = 'GatewayTimeout'; + })((HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}))); + var Headers; + (function (Headers2) { + Headers2['Accept'] = 'accept'; + Headers2['ContentType'] = 'content-type'; + })((Headers = exports.Headers || (exports.Headers = {}))); + var MediaTypes; + (function (MediaTypes2) { + MediaTypes2['ApplicationJson'] = 'application/json'; + })((MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}))); + function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; + } + exports.getProxyUrl = getProxyUrl; + var HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect, + ]; + var HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout]; + var RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; + var ExponentialBackoffCeiling = 10; + var ExponentialBackoffTimeSlice = 5; + var HttpClientError = class extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); + } + }; + exports.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => + __awaiter(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + }) + ); + }); + } + }; + exports.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; + } + exports.isHttps = isHttps; + var HttpClient = class { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } + } + } + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + }); + } + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + }); + } + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + }); + } + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + }); + } + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + }); + } + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + }); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); + } + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.Accept, + MediaTypes.ApplicationJson + ); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.Accept, + MediaTypes.ApplicationJson + ); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.ContentType, + MediaTypes.ApplicationJson + ); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.Accept, + MediaTypes.ApplicationJson + ); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.ContentType, + MediaTypes.ApplicationJson + ); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.Accept, + MediaTypes.ApplicationJson + ); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader( + additionalHeaders, + Headers.ContentType, + MediaTypes.ApplicationJson + ); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error('Client has already been disposed.'); + } + const parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } else { + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while ( + response.message.statusCode && + HttpRedirectCodes.includes(response.message.statusCode) && + this._allowRedirects && + redirectsRemaining > 0 + ) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if ( + parsedUrl.protocol === 'https:' && + parsedUrl.protocol !== parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade + ) { + throw new Error( + 'Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.' + ); + } + yield response.readBody(); + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; + }); + } + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; + } + requestRaw(info, data) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error('Unknown error')); + } else { + resolve(res); + } + } + this.requestRawWithCallback(info, data, callbackForResult); + }); + }); + } + requestRawWithCallback(info, data, onResult) { + if (typeof data === 'string') { + if (!info.options.headers) { + info.options.headers = {}; + } + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info.httpModule.request(info.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(void 0, res); + }); + let socket; + req.on('socket', (sock) => { + socket = sock; + }); + req.setTimeout(this._socketTimeout || 3 * 6e4, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info.options.path}`)); + }); + req.on('error', function (err) { + handleResult(err); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } else { + req.end(); + } + } + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; + info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info.options); + } + } + return info; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (this._keepAlive && !useProxy) { + agent = this._agent; + } + if (agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign( + Object.assign( + {}, + (proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`, + } + ), + { host: proxyUrl.hostname, port: proxyUrl.port } + ), + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; + } + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false, + }); + } + return agent; + } + _performExponentialBackoff(retryNumber) { + return __awaiter(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise((resolve) => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => + __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {}, + }; + if (statusCode === HttpCodes.NotFound) { + resolve(response); + } + function dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } catch (err) {} + if (statusCode > 299) { + let msg; + if (obj && obj.message) { + msg = obj.message; + } else if (contents && contents.length > 0) { + msg = contents; + } else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } else { + resolve(response); + } + }) + ); + }); + } + }; + exports.HttpClient = HttpClient; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + }, +}); + +// node_modules/@actions/http-client/lib/auth.js +var require_auth = __commonJS({ + 'node_modules/@actions/http-client/lib/auth.js'(exports) { + 'use strict'; + var __awaiter = + (exports && exports.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, '__esModule', { value: true }); + exports.PersonalAccessTokenCredentialHandler = + exports.BearerCredentialHandler = + exports.BasicCredentialHandler = + void 0; + var BasicCredentialHandler = class { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString( + 'base64' + )}`; + } + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } + }; + exports.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; + } + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Bearer ${this.token}`; + } + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } + }; + exports.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; + } + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; + } + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } + }; + exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + }, +}); + +// node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils = __commonJS({ + 'node_modules/@actions/core/lib/oidc-utils.js'(exports) { + 'use strict'; + var __awaiter = + (exports && exports.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, '__esModule', { value: true }); + exports.OidcClient = void 0; + var http_client_1 = require_lib2(); + var auth_1 = require_auth(); + var core_1 = require_core2(); + var OidcClient = class { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry, + }; + return new http_client_1.HttpClient( + 'actions/oidc-client', + [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], + requestOptions + ); + } + static getRequestToken() { + const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; + if (!token) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); + } + return token; + } + static getIDTokenUrl() { + const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; + if (!runtimeUrl) { + throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); + } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const httpclient = OidcClient.createHttpClient(); + const res = yield httpclient.getJson(id_token_url).catch((error) => { + throw new Error(`Failed to get ID Token. + + Error Code : ${error.statusCode} + + Error Message: ${error.result.message}`); + }); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error('Response json body do not have ID Token field'); + } + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter(this, void 0, void 0, function* () { + try { + let id_token_url = OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + core_1.debug(`ID token url is ${id_token_url}`); + const id_token = yield OidcClient.getCall(id_token_url); + core_1.setSecret(id_token); + return id_token; + } catch (error) { + throw new Error(`Error message: ${error.message}`); + } + }); + } + }; + exports.OidcClient = OidcClient; + }, +}); + +// node_modules/@actions/core/lib/summary.js +var require_summary = __commonJS({ + 'node_modules/@actions/core/lib/summary.js'(exports) { + 'use strict'; + var __awaiter = + (exports && exports.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, '__esModule', { value: true }); + exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; + var os_1 = require('os'); + var fs_1 = require('fs'); + var { access, appendFile, writeFile } = fs_1.promises; + exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; + exports.SUMMARY_DOCS_URL = + 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; + var Summary = class { + constructor() { + this._buffer = ''; + } + filePath() { + return __awaiter(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; + } + const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error( + `Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.` + ); + } + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + throw new Error( + `Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.` + ); + } + this._filePath = pathFromEnv; + return this._filePath; + }); + } + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs) + .map(([key, value]) => ` ${key}="${value}"`) + .join(''); + if (!content) { + return `<${tag}${htmlAttrs}>`; + } + return `<${tag}${htmlAttrs}>${content}`; + } + write(options) { + return __awaiter(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: 'utf8' }); + return this.emptyBuffer(); + }); + } + clear() { + return __awaiter(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); + } + stringify() { + return this._buffer; + } + isEmptyBuffer() { + return this._buffer.length === 0; + } + emptyBuffer() { + this._buffer = ''; + return this; + } + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + addEOL() { + return this.addRaw(os_1.EOL); + } + addCodeBlock(code, lang) { + const attrs = Object.assign({}, lang && { lang }); + const element = this.wrap('pre', this.wrap('code', code), attrs); + return this.addRaw(element).addEOL(); + } + addList(items, ordered = false) { + const tag = ordered ? 'ol' : 'ul'; + const listItems = items.map((item) => this.wrap('li', item)).join(''); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + addTable(rows) { + const tableBody = rows + .map((row) => { + const cells = row + .map((cell) => { + if (typeof cell === 'string') { + return this.wrap('td', cell); + } + const { header, data, colspan, rowspan } = cell; + const tag = header ? 'th' : 'td'; + const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); + return this.wrap(tag, data, attrs); + }) + .join(''); + return this.wrap('tr', cells); + }) + .join(''); + const element = this.wrap('table', tableBody); + return this.addRaw(element).addEOL(); + } + addDetails(label, content) { + const element = this.wrap('details', this.wrap('summary', label) + content); + return this.addRaw(element).addEOL(); + } + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); + const element = this.wrap('img', null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); + } + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag) ? tag : 'h1'; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); + } + addSeparator() { + const element = this.wrap('hr', null); + return this.addRaw(element).addEOL(); + } + addBreak() { + const element = this.wrap('br', null); + return this.addRaw(element).addEOL(); + } + addQuote(text, cite) { + const attrs = Object.assign({}, cite && { cite }); + const element = this.wrap('blockquote', text, attrs); + return this.addRaw(element).addEOL(); + } + addLink(text, href) { + const element = this.wrap('a', text, { href }); + return this.addRaw(element).addEOL(); + } + }; + var _summary = new Summary(); + exports.markdownSummary = _summary; + exports.summary = _summary; + }, +}); + +// node_modules/@actions/core/lib/path-utils.js +var require_path_utils = __commonJS({ + 'node_modules/@actions/core/lib/path-utils.js'(exports) { + 'use strict'; + var __createBinding = + (exports && exports.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (exports && exports.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, 'default', { enumerable: true, value: v }); + } + : function (o, v) { + o['default'] = v; + }); + var __importStar = + (exports && exports.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== 'default' && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, '__esModule', { value: true }); + exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; + var path = __importStar(require('path')); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, '/'); + } + exports.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, '\\'); + } + exports.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path.sep); + } + exports.toPlatformPath = toPlatformPath; + }, +}); + +// node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + 'node_modules/@actions/core/lib/core.js'(exports) { + 'use strict'; + var __createBinding = + (exports && exports.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + }, + }); + } + : function (o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = + (exports && exports.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, 'default', { enumerable: true, value: v }); + } + : function (o, v) { + o['default'] = v; + }); + var __importStar = + (exports && exports.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (k !== 'default' && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __awaiter = + (exports && exports.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, '__esModule', { value: true }); + exports.getIDToken = + exports.getState = + exports.saveState = + exports.group = + exports.endGroup = + exports.startGroup = + exports.info = + exports.notice = + exports.warning = + exports.error = + exports.debug = + exports.isDebug = + exports.setFailed = + exports.setCommandEcho = + exports.setOutput = + exports.getBooleanInput = + exports.getMultilineInput = + exports.getInput = + exports.addPath = + exports.setSecret = + exports.exportVariable = + exports.ExitCode = + void 0; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os = __importStar(require('os')); var path = __importStar(require('path')); + var uuid_1 = require_dist(); + var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function (ExitCode2) { ExitCode2[(ExitCode2['Success'] = 0)] = 'Success'; @@ -19861,7 +21698,13 @@ var require_core2 = __commonJS({ process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { - const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const delimiter = `ghadelimiter_${uuid_1.v4()}`; + if (name.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedVal.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; file_command_1.issueCommand('ENV', commandValue); } else { @@ -19888,10 +21731,31 @@ var require_core2 = __commonJS({ if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } + if (options && options.trimWhitespace === false) { + return val; + } return val.trim(); } exports.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options) + .split('\n') + .filter((x) => x !== ''); + return inputs; + } + exports.getMultilineInput = getMultilineInput; + function getBooleanInput(name, options) { + const trueValue = ['true', 'True', 'TRUE']; + const falseValue = ['false', 'False', 'FALSE']; + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; + if (falseValue.includes(val)) return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); + } + exports.getBooleanInput = getBooleanInput; function setOutput2(name, value) { + process.stdout.write(os.EOL); command_1.issueCommand('set-output', { name }, value); } exports.setOutput = setOutput2; @@ -19912,14 +21776,30 @@ var require_core2 = __commonJS({ command_1.issueCommand('debug', {}, message); } exports.debug = debug; - function error(message) { - command_1.issue('error', message instanceof Error ? message.toString() : message); + function error(message, properties = {}) { + command_1.issueCommand( + 'error', + utils_1.toCommandProperties(properties), + message instanceof Error ? message.toString() : message + ); } exports.error = error; - function warning(message) { - command_1.issue('warning', message instanceof Error ? message.toString() : message); + function warning(message, properties = {}) { + command_1.issueCommand( + 'warning', + utils_1.toCommandProperties(properties), + message instanceof Error ? message.toString() : message + ); } exports.warning = warning; + function notice(message, properties = {}) { + command_1.issueCommand( + 'notice', + utils_1.toCommandProperties(properties), + message instanceof Error ? message.toString() : message + ); + } + exports.notice = notice; function info(message) { process.stdout.write(message + os.EOL); } @@ -19953,6 +21833,45 @@ var require_core2 = __commonJS({ return process.env[`STATE_${name}`] || ''; } exports.getState = getState; + function getIDToken(aud) { + return __awaiter(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); + } + exports.getIDToken = getIDToken; + var summary_1 = require_summary(); + Object.defineProperty(exports, 'summary', { + enumerable: true, + get: function () { + return summary_1.summary; + }, + }); + var summary_2 = require_summary(); + Object.defineProperty(exports, 'markdownSummary', { + enumerable: true, + get: function () { + return summary_2.markdownSummary; + }, + }); + var path_utils_1 = require_path_utils(); + Object.defineProperty(exports, 'toPosixPath', { + enumerable: true, + get: function () { + return path_utils_1.toPosixPath; + }, + }); + Object.defineProperty(exports, 'toWin32Path', { + enumerable: true, + get: function () { + return path_utils_1.toWin32Path; + }, + }); + Object.defineProperty(exports, 'toPlatformPath', { + enumerable: true, + get: function () { + return path_utils_1.toPlatformPath; + }, + }); }, }); diff --git a/package-lock.json b/package-lock.json index 8bcf2ffd..f7fee2f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@types/jest": "27.5.2", - "@types/node": "16.11.47", + "@types/node": "16.11.57", "@typescript-eslint/eslint-plugin": "5.23.0", "@typescript-eslint/parser": "5.23.0", "ajv-keywords": "5.1.0", @@ -1368,9 +1368,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.11.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.47.tgz", - "integrity": "sha512-fpP+jk2zJ4VW66+wAMFoBJlx1bxmBKx4DUFf68UHgdGCOuyUTDlLWqsaNPJh7xhNDykyJ9eIzAygilP/4WoN8g==", + "version": "16.11.57", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.57.tgz", + "integrity": "sha512-diBb5AE2V8h9Fs9zEDtBwSeLvIACng/aAkdZ3ujMV+cGuIQ9Nc/V+wQqurk9HJp8ni5roBxQHW21z/ZYbGDivg==", "dev": true }, "node_modules/@types/parse-json": { @@ -10180,9 +10180,9 @@ "dev": true }, "@types/node": { - "version": "16.11.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.47.tgz", - "integrity": "sha512-fpP+jk2zJ4VW66+wAMFoBJlx1bxmBKx4DUFf68UHgdGCOuyUTDlLWqsaNPJh7xhNDykyJ9eIzAygilP/4WoN8g==", + "version": "16.11.57", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.57.tgz", + "integrity": "sha512-diBb5AE2V8h9Fs9zEDtBwSeLvIACng/aAkdZ3ujMV+cGuIQ9Nc/V+wQqurk9HJp8ni5roBxQHW21z/ZYbGDivg==", "dev": true }, "@types/parse-json": { diff --git a/package.json b/package.json index 57b4ea46..b8792e5d 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ }, "devDependencies": { "@types/jest": "27.5.2", - "@types/node": "16.11.47", + "@types/node": "16.11.57", "@typescript-eslint/eslint-plugin": "5.23.0", "@typescript-eslint/parser": "5.23.0", "ajv-keywords": "5.1.0", From 1136b6b477296e2560e5f4f8be7b5e5735dc8456 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 24 Nov 2022 14:10:05 +0900 Subject: [PATCH 3/6] Bump @actions/core to 1.10.0 (#244) Github announced deprecation of `set-output` command, so we need to update core lib to 1.10.0 that reacts changes. https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ ``` Action authors who are using the toolkit should update the @actions/core package to v1.10.0 or greater to get the updated saveState and setOutput functions. ``` --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index f7fee2f3..3691cb5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "3.3.1", "license": "MIT", "dependencies": { - "@actions/core": "^1.9.1", + "@actions/core": "^1.10.0", "aws-sdk": "^2.681.0" }, "devDependencies": { @@ -42,9 +42,9 @@ } }, "node_modules/@actions/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz", - "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", "dependencies": { "@actions/http-client": "^2.0.1", "uuid": "^8.3.2" @@ -9122,9 +9122,9 @@ }, "dependencies": { "@actions/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz", - "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", "requires": { "@actions/http-client": "^2.0.1", "uuid": "^8.3.2" diff --git a/package.json b/package.json index b8792e5d..e5884b1c 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ }, "author": "Gago ", "dependencies": { - "@actions/core": "^1.9.1", + "@actions/core": "^1.10.0", "aws-sdk": "^2.681.0" }, "devDependencies": { From 4d17f4e4212ff000a086734c265dfcbc74a44a51 Mon Sep 17 00:00:00 2001 From: Gago Date: Wed, 30 Nov 2022 12:45:59 -0500 Subject: [PATCH 4/6] This Workflow should provide us with the dist/ bundle always up to date (#247) The latest commits from @DevJeon1358 have been great for the action to keep working correctly with the latest updates from Github (mainly deprecations). But Something I did not cover before in this action was the ability to keep the built binary within the action (that has to be committed) up to date when a PR changes libraries or code itself. This PR adds a workflow that "Hopefully" will solve this. Co-authored-by: GitHub Action --- .github/workflows/rebuild_dist.yml | 50 ++++++++++++++++++++++++++++ dist/index.js | 52 +++++++++++++++++++----------- 2 files changed, 83 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/rebuild_dist.yml diff --git a/.github/workflows/rebuild_dist.yml b/.github/workflows/rebuild_dist.yml new file mode 100644 index 00000000..0aeafd7d --- /dev/null +++ b/.github/workflows/rebuild_dist.yml @@ -0,0 +1,50 @@ +name: rebuild dist/ if needed + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{github.head_ref}} + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + + - uses: actions/setup-node@v3.5.1 + with: + cache: 'npm' + node-version-file: '.nvmrc' + + - run: npm install + - name: build dist/ + run: npm run build + - run: | + STATUS=$(git diff --quiet && echo clean || echo modified) + echo "status=$(echo $STATUS)" >> $GITHUB_OUTPUT + id: gitStatus + - run: | + echo ${{ steps.gitStatus.outputs.status }} + echo ${{ contains(steps.gitStatus.outputs.status, 'modified') }} + - name: Commit dist/ files + if: contains(steps.gitStatus.outputs.status, 'modified') + run: | + set -x + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m "rebuild dist/" -a + - id: auth + if: contains(steps.gitStatus.outputs.status, 'modified') + uses: jnwng/github-app-installation-token-action@v2 + with: + appId: ${{ secrets.COMMIT_BUILD_TO_PR_APP_ID }} + installationId: ${{ secrets.COMMIT_BUILD_TO_PR_INSTALLATION_ID }} + privateKey: ${{ secrets.COMMIT_BUILD_TO_PR_PRIVATE_KEY }} + - name: Push changes + if: contains(steps.gitStatus.outputs.status, 'modified') + uses: ad-m/github-push-action@master + with: + github_token: ${{ steps.auth.outputs.token }} + branch: ${{github.head_ref}} diff --git a/dist/index.js b/dist/index.js index 649104e9..9bd545e9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -20211,11 +20211,12 @@ var require_file_command = __commonJS({ return result; }; Object.defineProperty(exports, '__esModule', { value: true }); - exports.issueCommand = void 0; + exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; var fs = __importStar(require('fs')); var os = __importStar(require('os')); + var uuid_1 = require_dist(); var utils_1 = require_utils(); - function issueCommand(command, message) { + function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); @@ -20227,7 +20228,19 @@ var require_file_command = __commonJS({ encoding: 'utf8', }); } - exports.issueCommand = issueCommand; + exports.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${uuid_1.v4()}`; + const convertedValue = utils_1.toCommandValue(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; + } + exports.prepareKeyValueMessage = prepareKeyValueMessage; }, }); @@ -21686,7 +21699,6 @@ var require_core2 = __commonJS({ var utils_1 = require_utils(); var os = __importStar(require('os')); var path = __importStar(require('path')); - var uuid_1 = require_dist(); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function (ExitCode2) { @@ -21698,18 +21710,9 @@ var require_core2 = __commonJS({ process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { - const delimiter = `ghadelimiter_${uuid_1.v4()}`; - if (name.includes(delimiter)) { - throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); - } - if (convertedVal.includes(delimiter)) { - throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); - } - const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; - file_command_1.issueCommand('ENV', commandValue); - } else { - command_1.issueCommand('set-env', { name }, convertedVal); + return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val)); } + command_1.issueCommand('set-env', { name }, convertedVal); } exports.exportVariable = exportVariable; function setSecret2(secret) { @@ -21719,7 +21722,7 @@ var require_core2 = __commonJS({ function addPath(inputPath) { const filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { - file_command_1.issueCommand('PATH', inputPath); + file_command_1.issueFileCommand('PATH', inputPath); } else { command_1.issueCommand('add-path', {}, inputPath); } @@ -21741,7 +21744,10 @@ var require_core2 = __commonJS({ const inputs = getInput2(name, options) .split('\n') .filter((x) => x !== ''); - return inputs; + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map((input) => input.trim()); } exports.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { @@ -21755,8 +21761,12 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.getBooleanInput = getBooleanInput; function setOutput2(name, value) { + const filePath = process.env['GITHUB_OUTPUT'] || ''; + if (filePath) { + return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value)); + } process.stdout.write(os.EOL); - command_1.issueCommand('set-output', { name }, value); + command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value)); } exports.setOutput = setOutput2; function setCommandEcho(enabled) { @@ -21826,7 +21836,11 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.group = group; function saveState(name, value) { - command_1.issueCommand('save-state', { name }, value); + const filePath = process.env['GITHUB_STATE'] || ''; + if (filePath) { + return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value)); + } + command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value)); } exports.saveState = saveState; function getState(name) { From b5a2d1dbb33d2695c64e2236726151197f9720ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 18:10:35 -0500 Subject: [PATCH 5/6] Bump json5 from 2.2.1 to 2.2.3 (#249) Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
Release notes

Sourced from json5's releases.

v2.2.3

  • Fix: json5@2.2.3 is now the 'latest' release according to npm instead of v1.0.2. (#299)

v2.2.2

  • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).
Changelog

Sourced from json5's changelog.

v2.2.3 [code, diff]

  • Fix: json5@2.2.3 is now the 'latest' release according to npm instead of v1.0.2. (#299)

v2.2.2 [code, diff]

  • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).
Commits
  • c3a7524 2.2.3
  • 94fd06d docs: update CHANGELOG for v2.2.3
  • 3b8cebf docs(security): use GitHub security advisories
  • f0fd9e1 docs: publish a security policy
  • 6a91a05 docs(template): bug -> bug report
  • 14f8cb1 2.2.2
  • 10cc7ca docs: update CHANGELOG for v2.2.2
  • 7774c10 fix: add proto to objects and arrays
  • edde30a Readme: slight tweak to intro
  • 97286f8 Improve example in readme
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=json5&package-manager=npm_and_yarn&previous-version=2.2.1&new-version=2.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/gagoar/invoke-aws-lambda/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3691cb5f..51793d2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5684,9 +5684,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -13253,9 +13253,9 @@ "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "kleur": { From aeda4dffcd1a2e247f0d07af812de833d12eaa5b Mon Sep 17 00:00:00 2001 From: Gago Date: Fri, 20 Jan 2023 18:20:28 -0500 Subject: [PATCH 6/6] 3.3.2 (#251) Bump version 3.3.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 51793d2d..b4373ed2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "invoke-aws-lambda", - "version": "3.3.1", + "version": "3.3.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "invoke-aws-lambda", - "version": "3.3.1", + "version": "3.3.2", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/package.json b/package.json index e5884b1c..f5a87cae 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "invoke-aws-lambda", "repository": "git@github.com:gagoar/invoke-aws-lambda.git", "license": "MIT", - "version": "3.3.1", + "version": "3.3.2", "description": "Invoke AWS Lambda", "main": "index.ts", "husky": {