Skip to content

Commit d689040

Browse files
committed
Build next v1
1 parent afcec70 commit d689040

File tree

2 files changed

+6074
-21
lines changed

2 files changed

+6074
-21
lines changed

dist/index.js

Lines changed: 84 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,32 @@ class SemVer {
13751375
module.exports = SemVer
13761376

13771377

1378+
/***/ }),
1379+
1380+
/***/ 82:
1381+
/***/ (function(__unusedmodule, exports) {
1382+
1383+
"use strict";
1384+
1385+
// We use any as a valid input type
1386+
/* eslint-disable @typescript-eslint/no-explicit-any */
1387+
Object.defineProperty(exports, "__esModule", { value: true });
1388+
/**
1389+
* Sanitizes an input into a string so it can be passed into issueCommand safely
1390+
* @param input input to sanitize into a string
1391+
*/
1392+
function toCommandValue(input) {
1393+
if (input === null || input === undefined) {
1394+
return '';
1395+
}
1396+
else if (typeof input === 'string' || input instanceof String) {
1397+
return input;
1398+
}
1399+
return JSON.stringify(input);
1400+
}
1401+
exports.toCommandValue = toCommandValue;
1402+
//# sourceMappingURL=utils.js.map
1403+
13781404
/***/ }),
13791405

13801406
/***/ 85:
@@ -1415,6 +1441,42 @@ module.exports = require("os");
14151441

14161442
/***/ }),
14171443

1444+
/***/ 102:
1445+
/***/ (function(__unusedmodule, exports, __webpack_require__) {
1446+
1447+
"use strict";
1448+
1449+
// For internal use, subject to change.
1450+
var __importStar = (this && this.__importStar) || function (mod) {
1451+
if (mod && mod.__esModule) return mod;
1452+
var result = {};
1453+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
1454+
result["default"] = mod;
1455+
return result;
1456+
};
1457+
Object.defineProperty(exports, "__esModule", { value: true });
1458+
// We use any as a valid input type
1459+
/* eslint-disable @typescript-eslint/no-explicit-any */
1460+
const fs = __importStar(__webpack_require__(747));
1461+
const os = __importStar(__webpack_require__(87));
1462+
const utils_1 = __webpack_require__(82);
1463+
function issueCommand(command, message) {
1464+
const filePath = process.env[`GITHUB_${command}`];
1465+
if (!filePath) {
1466+
throw new Error(`Unable to find environment variable for file command ${command}`);
1467+
}
1468+
if (!fs.existsSync(filePath)) {
1469+
throw new Error(`Missing file at path: ${filePath}`);
1470+
}
1471+
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
1472+
encoding: 'utf8'
1473+
});
1474+
}
1475+
exports.issueCommand = issueCommand;
1476+
//# sourceMappingURL=file-command.js.map
1477+
1478+
/***/ }),
1479+
14181480
/***/ 120:
14191481
/***/ (function(module, __unusedexports, __webpack_require__) {
14201482

@@ -7954,6 +8016,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
79548016
};
79558017
Object.defineProperty(exports, "__esModule", { value: true });
79568018
const os = __importStar(__webpack_require__(87));
8019+
const utils_1 = __webpack_require__(82);
79578020
/**
79588021
* Commands
79598022
*
@@ -8007,28 +8070,14 @@ class Command {
80078070
return cmdStr;
80088071
}
80098072
}
8010-
/**
8011-
* Sanitizes an input into a string so it can be passed into issueCommand safely
8012-
* @param input input to sanitize into a string
8013-
*/
8014-
function toCommandValue(input) {
8015-
if (input === null || input === undefined) {
8016-
return '';
8017-
}
8018-
else if (typeof input === 'string' || input instanceof String) {
8019-
return input;
8020-
}
8021-
return JSON.stringify(input);
8022-
}
8023-
exports.toCommandValue = toCommandValue;
80248073
function escapeData(s) {
8025-
return toCommandValue(s)
8074+
return utils_1.toCommandValue(s)
80268075
.replace(/%/g, '%25')
80278076
.replace(/\r/g, '%0D')
80288077
.replace(/\n/g, '%0A');
80298078
}
80308079
function escapeProperty(s) {
8031-
return toCommandValue(s)
8080+
return utils_1.toCommandValue(s)
80328081
.replace(/%/g, '%25')
80338082
.replace(/\r/g, '%0D')
80348083
.replace(/\n/g, '%0A')
@@ -8149,6 +8198,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
81498198
};
81508199
Object.defineProperty(exports, "__esModule", { value: true });
81518200
const command_1 = __webpack_require__(431);
8201+
const file_command_1 = __webpack_require__(102);
8202+
const utils_1 = __webpack_require__(82);
81528203
const os = __importStar(__webpack_require__(87));
81538204
const path = __importStar(__webpack_require__(622));
81548205
/**
@@ -8175,9 +8226,17 @@ var ExitCode;
81758226
*/
81768227
// eslint-disable-next-line @typescript-eslint/no-explicit-any
81778228
function exportVariable(name, val) {
8178-
const convertedVal = command_1.toCommandValue(val);
8229+
const convertedVal = utils_1.toCommandValue(val);
81798230
process.env[name] = convertedVal;
8180-
command_1.issueCommand('set-env', { name }, convertedVal);
8231+
const filePath = process.env['GITHUB_ENV'] || '';
8232+
if (filePath) {
8233+
const delimiter = '_GitHubActionsFileCommandDelimeter_';
8234+
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
8235+
file_command_1.issueCommand('ENV', commandValue);
8236+
}
8237+
else {
8238+
command_1.issueCommand('set-env', { name }, convertedVal);
8239+
}
81818240
}
81828241
exports.exportVariable = exportVariable;
81838242
/**
@@ -8193,7 +8252,13 @@ exports.setSecret = setSecret;
81938252
* @param inputPath
81948253
*/
81958254
function addPath(inputPath) {
8196-
command_1.issueCommand('add-path', {}, inputPath);
8255+
const filePath = process.env['GITHUB_PATH'] || '';
8256+
if (filePath) {
8257+
file_command_1.issueCommand('PATH', inputPath);
8258+
}
8259+
else {
8260+
command_1.issueCommand('add-path', {}, inputPath);
8261+
}
81978262
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
81988263
}
81998264
exports.addPath = addPath;

0 commit comments

Comments
 (0)