Skip to content

Commit 5423639

Browse files
build(deps): bump @actions/core from 1.9.1 to 1.10.0 (#578)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent c225631 commit 5423639

File tree

4 files changed

+80
-50
lines changed

4 files changed

+80
-50
lines changed

dist/post_run/index.js

+36-21
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,6 @@ const file_command_1 = __nccwpck_require__(717);
14311431
const utils_1 = __nccwpck_require__(5278);
14321432
const os = __importStar(__nccwpck_require__(2037));
14331433
const path = __importStar(__nccwpck_require__(1017));
1434-
const uuid_1 = __nccwpck_require__(8974);
14351434
const oidc_utils_1 = __nccwpck_require__(8041);
14361435
/**
14371436
* The code to exit an action
@@ -1461,20 +1460,9 @@ function exportVariable(name, val) {
14611460
process.env[name] = convertedVal;
14621461
const filePath = process.env['GITHUB_ENV'] || '';
14631462
if (filePath) {
1464-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
1465-
// 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.
1466-
if (name.includes(delimiter)) {
1467-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
1468-
}
1469-
if (convertedVal.includes(delimiter)) {
1470-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
1471-
}
1472-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
1473-
file_command_1.issueCommand('ENV', commandValue);
1474-
}
1475-
else {
1476-
command_1.issueCommand('set-env', { name }, convertedVal);
1463+
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
14771464
}
1465+
command_1.issueCommand('set-env', { name }, convertedVal);
14781466
}
14791467
exports.exportVariable = exportVariable;
14801468
/**
@@ -1492,7 +1480,7 @@ exports.setSecret = setSecret;
14921480
function addPath(inputPath) {
14931481
const filePath = process.env['GITHUB_PATH'] || '';
14941482
if (filePath) {
1495-
file_command_1.issueCommand('PATH', inputPath);
1483+
file_command_1.issueFileCommand('PATH', inputPath);
14961484
}
14971485
else {
14981486
command_1.issueCommand('add-path', {}, inputPath);
@@ -1532,7 +1520,10 @@ function getMultilineInput(name, options) {
15321520
const inputs = getInput(name, options)
15331521
.split('\n')
15341522
.filter(x => x !== '');
1535-
return inputs;
1523+
if (options && options.trimWhitespace === false) {
1524+
return inputs;
1525+
}
1526+
return inputs.map(input => input.trim());
15361527
}
15371528
exports.getMultilineInput = getMultilineInput;
15381529
/**
@@ -1565,8 +1556,12 @@ exports.getBooleanInput = getBooleanInput;
15651556
*/
15661557
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15671558
function setOutput(name, value) {
1559+
const filePath = process.env['GITHUB_OUTPUT'] || '';
1560+
if (filePath) {
1561+
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
1562+
}
15681563
process.stdout.write(os.EOL);
1569-
command_1.issueCommand('set-output', { name }, value);
1564+
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
15701565
}
15711566
exports.setOutput = setOutput;
15721567
/**
@@ -1695,7 +1690,11 @@ exports.group = group;
16951690
*/
16961691
// eslint-disable-next-line @typescript-eslint/no-explicit-any
16971692
function saveState(name, value) {
1698-
command_1.issueCommand('save-state', { name }, value);
1693+
const filePath = process.env['GITHUB_STATE'] || '';
1694+
if (filePath) {
1695+
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
1696+
}
1697+
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
16991698
}
17001699
exports.saveState = saveState;
17011700
/**
@@ -1761,13 +1760,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
17611760
return result;
17621761
};
17631762
Object.defineProperty(exports, "__esModule", ({ value: true }));
1764-
exports.issueCommand = void 0;
1763+
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
17651764
// We use any as a valid input type
17661765
/* eslint-disable @typescript-eslint/no-explicit-any */
17671766
const fs = __importStar(__nccwpck_require__(7147));
17681767
const os = __importStar(__nccwpck_require__(2037));
1768+
const uuid_1 = __nccwpck_require__(8974);
17691769
const utils_1 = __nccwpck_require__(5278);
1770-
function issueCommand(command, message) {
1770+
function issueFileCommand(command, message) {
17711771
const filePath = process.env[`GITHUB_${command}`];
17721772
if (!filePath) {
17731773
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -1779,7 +1779,22 @@ function issueCommand(command, message) {
17791779
encoding: 'utf8'
17801780
});
17811781
}
1782-
exports.issueCommand = issueCommand;
1782+
exports.issueFileCommand = issueFileCommand;
1783+
function prepareKeyValueMessage(key, value) {
1784+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
1785+
const convertedValue = utils_1.toCommandValue(value);
1786+
// These should realistically never happen, but just in case someone finds a
1787+
// way to exploit uuid generation let's not allow keys or values that contain
1788+
// the delimiter.
1789+
if (key.includes(delimiter)) {
1790+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
1791+
}
1792+
if (convertedValue.includes(delimiter)) {
1793+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
1794+
}
1795+
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
1796+
}
1797+
exports.prepareKeyValueMessage = prepareKeyValueMessage;
17831798
//# sourceMappingURL=file-command.js.map
17841799

17851800
/***/ }),

dist/run/index.js

+36-21
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,6 @@ const file_command_1 = __nccwpck_require__(717);
14311431
const utils_1 = __nccwpck_require__(5278);
14321432
const os = __importStar(__nccwpck_require__(2037));
14331433
const path = __importStar(__nccwpck_require__(1017));
1434-
const uuid_1 = __nccwpck_require__(8974);
14351434
const oidc_utils_1 = __nccwpck_require__(8041);
14361435
/**
14371436
* The code to exit an action
@@ -1461,20 +1460,9 @@ function exportVariable(name, val) {
14611460
process.env[name] = convertedVal;
14621461
const filePath = process.env['GITHUB_ENV'] || '';
14631462
if (filePath) {
1464-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
1465-
// 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.
1466-
if (name.includes(delimiter)) {
1467-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
1468-
}
1469-
if (convertedVal.includes(delimiter)) {
1470-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
1471-
}
1472-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
1473-
file_command_1.issueCommand('ENV', commandValue);
1474-
}
1475-
else {
1476-
command_1.issueCommand('set-env', { name }, convertedVal);
1463+
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
14771464
}
1465+
command_1.issueCommand('set-env', { name }, convertedVal);
14781466
}
14791467
exports.exportVariable = exportVariable;
14801468
/**
@@ -1492,7 +1480,7 @@ exports.setSecret = setSecret;
14921480
function addPath(inputPath) {
14931481
const filePath = process.env['GITHUB_PATH'] || '';
14941482
if (filePath) {
1495-
file_command_1.issueCommand('PATH', inputPath);
1483+
file_command_1.issueFileCommand('PATH', inputPath);
14961484
}
14971485
else {
14981486
command_1.issueCommand('add-path', {}, inputPath);
@@ -1532,7 +1520,10 @@ function getMultilineInput(name, options) {
15321520
const inputs = getInput(name, options)
15331521
.split('\n')
15341522
.filter(x => x !== '');
1535-
return inputs;
1523+
if (options && options.trimWhitespace === false) {
1524+
return inputs;
1525+
}
1526+
return inputs.map(input => input.trim());
15361527
}
15371528
exports.getMultilineInput = getMultilineInput;
15381529
/**
@@ -1565,8 +1556,12 @@ exports.getBooleanInput = getBooleanInput;
15651556
*/
15661557
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15671558
function setOutput(name, value) {
1559+
const filePath = process.env['GITHUB_OUTPUT'] || '';
1560+
if (filePath) {
1561+
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
1562+
}
15681563
process.stdout.write(os.EOL);
1569-
command_1.issueCommand('set-output', { name }, value);
1564+
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
15701565
}
15711566
exports.setOutput = setOutput;
15721567
/**
@@ -1695,7 +1690,11 @@ exports.group = group;
16951690
*/
16961691
// eslint-disable-next-line @typescript-eslint/no-explicit-any
16971692
function saveState(name, value) {
1698-
command_1.issueCommand('save-state', { name }, value);
1693+
const filePath = process.env['GITHUB_STATE'] || '';
1694+
if (filePath) {
1695+
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
1696+
}
1697+
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
16991698
}
17001699
exports.saveState = saveState;
17011700
/**
@@ -1761,13 +1760,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
17611760
return result;
17621761
};
17631762
Object.defineProperty(exports, "__esModule", ({ value: true }));
1764-
exports.issueCommand = void 0;
1763+
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
17651764
// We use any as a valid input type
17661765
/* eslint-disable @typescript-eslint/no-explicit-any */
17671766
const fs = __importStar(__nccwpck_require__(7147));
17681767
const os = __importStar(__nccwpck_require__(2037));
1768+
const uuid_1 = __nccwpck_require__(8974);
17691769
const utils_1 = __nccwpck_require__(5278);
1770-
function issueCommand(command, message) {
1770+
function issueFileCommand(command, message) {
17711771
const filePath = process.env[`GITHUB_${command}`];
17721772
if (!filePath) {
17731773
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -1779,7 +1779,22 @@ function issueCommand(command, message) {
17791779
encoding: 'utf8'
17801780
});
17811781
}
1782-
exports.issueCommand = issueCommand;
1782+
exports.issueFileCommand = issueFileCommand;
1783+
function prepareKeyValueMessage(key, value) {
1784+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
1785+
const convertedValue = utils_1.toCommandValue(value);
1786+
// These should realistically never happen, but just in case someone finds a
1787+
// way to exploit uuid generation let's not allow keys or values that contain
1788+
// the delimiter.
1789+
if (key.includes(delimiter)) {
1790+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
1791+
}
1792+
if (convertedValue.includes(delimiter)) {
1793+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
1794+
}
1795+
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
1796+
}
1797+
exports.prepareKeyValueMessage = prepareKeyValueMessage;
17831798
//# sourceMappingURL=file-command.js.map
17841799

17851800
/***/ }),

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"license": "MIT",
2626
"dependencies": {
2727
"@actions/cache": "^3.0.4",
28-
"@actions/core": "^1.9.1",
28+
"@actions/core": "^1.10.0",
2929
"@actions/exec": "^1.1.1",
3030
"@actions/github": "^5.1.1",
3131
"@actions/http-client": "^2.0.1",

0 commit comments

Comments
 (0)