8000 build(deps): bump @actions/core to 1.10.0 (#1274) · peter-evans/create-pull-request@ef83023 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef83023

Browse files
authored
build(deps): bump @actions/core to 1.10.0 (#1274)
1 parent 671dc9c commit ef83023

File tree

3 files changed

+44
-29
lines changed

3 files changed

+44
-29
lines changed

dist/index.js

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,6 @@ const file_command_1 = __nccwpck_require__(717);
14581458
const utils_1 = __nccwpck_require__(5278);
14591459
const os = __importStar(__nccwpck_require__(2037));
14601460
const path = __importStar(__nccwpck_require__(1017));
1461-
const uuid_1 = __nccwpck_require__(5840);
14621461
const oidc_utils_1 = __nccwpck_require__(8041);
14631462
/**
14641463
* The code to exit an action
@@ -1488,20 +1487,9 @@ function exportVariable(name, val) {
14881487
process.env[name] = convertedVal;
14891488
const filePath = process.env['GITHUB_ENV'] || '';
14901489
if (filePath) {
1491-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
1492-
// These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
1493-
if (name.includes(delimiter)) {
1494-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
1495-
}
1496-
if (convertedVal.includes(delimiter)) {
1497-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
1498-
}
1499-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
1500-
file_command_1.issueCommand('ENV', commandValue);
1501-
}
1502-
else {
1503-
command_1.issueCommand('set-env', { name }, convertedVal);
1490+
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
15041491
}
1492+
command_1.issueCommand('set-env', { name }, convertedVal);
15051493
}
15061494
exports.exportVariable = exportVariable;
15071495
/**
@@ -1519,7 +1507,7 @@ exports.setSecret = setSecret;
15191507
function addPath(inputPath) {
15201508
const filePath = process.env['GITHUB_PATH'] || '';
15211509
if (filePath) {
1522-
file_command_1.issueCommand('PATH', inputPath);
1510+
file_command_1.issueFileCommand('PATH', inputPath);
15231511
}
15241512
else {
15251513
command_1.issueCommand('add-path', {}, inputPath);
@@ -1559,7 +1547,10 @@ function getMultilineInput(name, options) {
15591547
const inputs = getInput(name, options)
15601548
.split('\n')
15611549
.filter(x => x !== '');
1562-
return inputs;
1550+
if (options && options.trimWhitespace === false) {
1551+
return inputs;
1552+
}
1553+
return inputs.map(input => input.trim());
15631554
}
15641555
exports.getMultilineInput = getMultilineInput;
15651556
/**
@@ -1592,8 +1583,12 @@ exports.getBooleanInput = getBooleanInput;
15921583
*/
15931584
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15941585
function setOutput(name, value) {
1586+
const filePath = process.env['GITHUB_OUTPUT'] || '';
1587+
if (filePath) {
1588+
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
1589+
}
15951590
process.stdout.write(os.EOL);
1596-
command_1.issueCommand('set-output', { name }, value);
1591+
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
15971592
}
15981593
exports.setOutput = setOutput;
15991594
/**
@@ -1722,7 +1717,11 @@ exports.group = group;
17221717
*/
17231718
// eslint-disable-next-line @typescript-eslint/no-explicit-any
17241719
function saveState(name, value) {
1725-
command_1.issueCommand('save-state', { name }, value);
1720+
const filePath = process.env['G 8000 ITHUB_STATE'] || '';
1721+
if (filePath) {
1722+
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
1723+
}
1724+
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
17261725
}
17271726
exports.saveState = saveState;
17281727
/**
@@ -1788,13 +1787,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
17881787
return result;
17891788
};
17901789
Object.defineProperty(exports, "__esModule", ({ value: true }));
1791-
exports.issueCommand = void 0;
1790+
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
17921791
// We use any as a valid input type
17931792
/* eslint-disable @typescript-eslint/no-explicit-any */
17941793
const fs = __importStar(__nccwpck_require__(7147));
17951794
const os = __importStar(__nccwpck_require__(2037));
1795+
const uuid_1 = __nccwpck_require__(5840);
17961796
const utils_1 = __nccwpck_require__(5278);
1797-
function issueCommand(command, message) {
1797+
function issueFileCommand(command, message) {
17981798
const filePath = process.env[`GITHUB_${command}`];
17991799
if (!filePath) {
18001800
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -1806,7 +1806,22 @@ function issueCommand(command, message) {
18061806
encoding: 'utf8'
18071807
});
18081808
}
1809-
exports.issueCommand = issueCommand;
1809+
exports.issueFileCommand = issueFileCommand;
1810+
function prepareKeyValueMessage(key, value) {
1811+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
1812+
const convertedValue = utils_1.toCommandValue(value);
1813+
// These should realistically never happen, but just in case someone finds a
1814+
// way to exploit uuid generation let's not allow keys or values that contain
1815+
// the delimiter.
1816+
if (key.includes(delimiter)) {
1817+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
1818+
}
1819+
if (convertedValue.includes(delimiter)) {
1820+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
1821+
}
1822+
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
1823+
}
1824+
exports.prepareKeyValueMessage = prepareKeyValueMessage;
18101825
//# sourceMappingURL=file-command.js.map
18111826

18121827
/***/ }),

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://github.com/peter-evans/create-pull-request",
3131
"dependencies": {
32-
"@actions/core": "^1.9.1",
32+
"@actions/core": "^1.10.0",
3333
"@actions/exec": "^1.1.0",
3434
"@octokit/core": "^3.5.1",
3535
"@octokit/plugin-paginate-rest": "^2.17.0",

0 commit comments

Comments
 (0)
0