@@ -1428,8 +1428,6 @@ var __importStar = (this && this.__importStar) || function (mod) { |
1428 | 1428 | }; |
1429 | 1429 | Object.defineProperty(exports, "__esModule", { value: true }); |
1430 | 1430 | const command_1 = __webpack_require__(351); |
1431 | | -const file_command_1 = __webpack_require__(717); |
1432 | | -const utils_1 = __webpack_require__(278); |
1433 | 1431 | const os = __importStar(__webpack_require__(87)); |
1434 | 1432 | const path = __importStar(__webpack_require__(622)); |
1435 | 1433 | /** |
@@ -1456,17 +1454,9 @@ var ExitCode; |
1456 | 1454 | */ |
1457 | 1455 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
1458 | 1456 | function exportVariable(name, val) { |
1459 | | - const convertedVal = utils_1.toCommandValue(val); |
| 1457 | + const convertedVal = command_1.toCommandValue(val); |
1460 | 1458 | process.env[name] = convertedVal; |
1461 | | - const filePath = process.env['GITHUB_ENV'] || ''; |
1462 | | - if (filePath) { |
1463 | | - const delimiter = '_GitHubActionsFileCommandDelimeter_'; |
1464 | | - const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; |
1465 | | - file_command_1.issueCommand('ENV', commandValue); |
1466 | | - } |
1467 | | - else { |
1468 | | - command_1.issueCommand('set-env', { name }, convertedVal); |
1469 | | - } |
| 1459 | + command_1.issueCommand('set-env', { name }, convertedVal); |
1470 | 1460 | } |
1471 | 1461 | exports.exportVariable = exportVariable; |
1472 | 1462 | /** |
@@ -1482,13 +1472,7 @@ exports.setSecret = setSecret; |
1482 | 1472 | * @param inputPath |
1483 | 1473 | */ |
1484 | 1474 | function addPath(inputPath) { |
1485 | | - const filePath = process.env['GITHUB_PATH'] || ''; |
1486 | | - if (filePath) { |
1487 | | - file_command_1.issueCommand('PATH', inputPath); |
1488 | | - } |
1489 | | - else { |
1490 | | - command_1.issueCommand('add-path', {}, inputPath); |
1491 | | - } |
| 1475 | + command_1.issueCommand('add-path', {}, inputPath); |
1492 | 1476 | process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; |
1493 | 1477 | } |
1494 | 1478 | exports.addPath = addPath; |
@@ -2270,32 +2254,6 @@ exports.request = request; |
2270 | 2254 | //# sourceMappingURL=index.js.map |
2271 | 2255 |
|
2272 | 2256 |
|
2273 | | -/***/ }), |
2274 | | - |
2275 | | -/***/ 278: |
2276 | | -/***/ (function(__unusedmodule, exports) { |
2277 | | - |
2278 | | -"use strict"; |
2279 | | - |
2280 | | -// We use any as a valid input type |
2281 | | -/* eslint-disable @typescript-eslint/no-explicit-any */ |
2282 | | -Object.defineProperty(exports, "__esModule", { value: true }); |
2283 | | -/** |
2284 | | - * Sanitizes an input into a string so it can be passed into issueCommand safely |
2285 | | - * @param input input to sanitize into a string |
2286 | | - */ |
2287 | | -function toCommandValue(input) { |
2288 | | - if (input === null || input === undefined) { |
2289 | | - return ''; |
2290 | | - } |
2291 | | - else if (typeof input === 'string' || input instanceof String) { |
2292 | | - return input; |
2293 | | - } |
2294 | | - return JSON.stringify(input); |
2295 | | -} |
2296 | | -exports.toCommandValue = toCommandValue; |
2297 | | -//# sourceMappingURL=utils.js.map |
2298 | | - |
2299 | 2257 | /***/ }), |
2300 | 2258 |
|
2301 | 2259 | /***/ 294: |
@@ -2377,7 +2335,6 @@ var __importStar = (this && this.__importStar) || function (mod) { |
2377 | 2335 | }; |
2378 | 2336 | Object.defineProperty(exports, "__esModule", { value: true }); |
2379 | 2337 | const os = __importStar(__webpack_require__(87)); |
2380 | | -const utils_1 = __webpack_require__(278); |
2381 | 2338 | /** |
2382 | 2339 | * Commands |
2383 | 2340 | * |
@@ -2431,14 +2388,28 @@ class Command { |
2431 | 2388 | return cmdStr; |
2432 | 2389 | } |
2433 | 2390 | } |
| 2391 | +/** |
| 2392 | + * Sanitizes an input into a string so it can be passed into issueCommand safely |
| 2393 | + * @param input input to sanitize into a string |
| 2394 | + */ |
| 2395 | +function toCommandValue(input) { |
| 2396 | + if (input === null || input === undefined) { |
| 2397 | + return ''; |
| 2398 | + } |
| 2399 | + else if (typeof input === 'string' || input instanceof String) { |
| 2400 | + return input; |
| 2401 | + } |
| 2402 | + return JSON.stringify(input); |
| 2403 | +} |
| 2404 | +exports.toCommandValue = toCommandValue; |
2434 | 2405 | function escapeData(s) { |
2435 | | - return utils_1.toCommandValue(s) |
| 2406 | + return toCommandValue(s) |
2436 | 2407 | .replace(/%/g, '%25') |
2437 | 2408 | .replace(/\r/g, '%0D') |
2438 | 2409 | .replace(/\n/g, '%0A'); |
2439 | 2410 | } |
2440 | 2411 | function escapeProperty(s) { |
2441 | | - return utils_1.toCommandValue(s) |
| 2412 | + return toCommandValue(s) |
2442 | 2413 | .replace(/%/g, '%25') |
2443 | 2414 | .replace(/\r/g, '%0D') |
2444 | 2415 | .replace(/\n/g, '%0A') |
@@ -5283,42 +5254,6 @@ module.exports.Singular = Hook.Singular |
5283 | 5254 | module.exports.Collection = Hook.Collection |
5284 | 5255 |
|
5285 | 5256 |
|
5286 | | -/***/ }), |
5287 | | - |
5288 | | -/***/ 717: |
5289 | | -/***/ (function(__unusedmodule, exports, __webpack_require__) { |
5290 | | - |
5291 | | -"use strict"; |
5292 | | - |
5293 | | -// For internal use, subject to change. |
5294 | | -var __importStar = (this && this.__importStar) || function (mod) { |
5295 | | - if (mod && mod.__esModule) return mod; |
5296 | | - var result = {}; |
5297 | | - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; |
5298 | | - result["default"] = mod; |
5299 | | - return result; |
5300 | | -}; |
5301 | | -Object.defineProperty(exports, "__esModule", { value: true }); |
5302 | | -// We use any as a valid input type |
5303 | | -/* eslint-disable @typescript-eslint/no-explicit-any */ |
5304 | | -const fs = __importStar(__webpack_require__(747)); |
5305 | | -const os = __importStar(__webpack_require__(87)); |
5306 | | -const utils_1 = __webpack_require__(278); |
5307 | | -function issueCommand(command, message) { |
5308 | | - const filePath = process.env[`GITHUB_${command}`]; |
5309 | | - if (!filePath) { |
5310 | | - throw new Error(`Unable to find environment variable for file command ${command}`); |
5311 | | - } |
5312 | | - if (!fs.existsSync(filePath)) { |
5313 | | - throw new Error(`Missing file at path: ${filePath}`); |
5314 | | - } |
5315 | | - fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { |
5316 | | - encoding: 'utf8' |
5317 | | - }); |
5318 | | -} |
5319 | | -exports.issueCommand = issueCommand; |
5320 | | -//# sourceMappingURL=file-command.js.map |
5321 | | - |
5322 | 5257 | /***/ }), |
5323 | 5258 |
|
5324 | 5259 | /***/ 720: |
|