Skip to content

Commit a3f5edc

Browse files
authored
Merge pull request #950 from rentziass/rentziass/update-actions-core
Update @actions/core to 1.10.0
2 parents 0f20846 + 831ee69 commit a3f5edc

5 files changed

Lines changed: 82 additions & 52 deletions

File tree

.licenses/npm/@actions/core.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/restore/index.js

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,13 +2954,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
29542954
return result;
29552955
};
29562956
Object.defineProperty(exports, "__esModule", { value: true });
2957-
exports.issueCommand = void 0;
2957+
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
29582958
// We use any as a valid input type
29592959
/* eslint-disable @typescript-eslint/no-explicit-any */
29602960
const fs = __importStar(__webpack_require__(747));
29612961
const os = __importStar(__webpack_require__(87));
2962+
const uuid_1 = __webpack_require__(25);
29622963
const utils_1 = __webpack_require__(82);
2963-
function issueCommand(command, message) {
2964+
function issueFileCommand(command, message) {
29642965
const filePath = process.env[`GITHUB_${command}`];
29652966
if (!filePath) {
29662967
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -2972,7 +2973,22 @@ function issueCommand(command, message) {
29722973
encoding: 'utf8'
29732974
});
29742975
}
2975-
exports.issueCommand = issueCommand;
2976+
exports.issueFileCommand = issueFileCommand;
2977+
function prepareKeyValueMessage(key, value) {
2978+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
2979+
const convertedValue = utils_1.toCommandValue(value);
2980+
// These should realistically never happen, but just in case someone finds a
2981+
// way to exploit uuid generation let's not allow keys or values that contain
2982+
// the delimiter.
2983+
if (key.includes(delimiter)) {
2984+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
2985+
}
2986+
if (convertedValue.includes(delimiter)) {
2987+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
2988+
}
2989+
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
2990+
}
2991+
exports.prepareKeyValueMessage = prepareKeyValueMessage;
29762992
//# sourceMappingURL=file-command.js.map
29772993

29782994
/***/ }),
@@ -40551,7 +40567,6 @@ const file_command_1 = __webpack_require__(102);
4055140567
const utils_1 = __webpack_require__(82);
4055240568
const os = __importStar(__webpack_require__(87));
4055340569
const path = __importStar(__webpack_require__(622));
40554-
const uuid_1 = __webpack_require__(25);
4055540570
const oidc_utils_1 = __webpack_require__(742);
4055640571
/**
4055740572
* The code to exit an action
@@ -40581,20 +40596,9 @@ function exportVariable(name, val) {
4058140596
process.env[name] = convertedVal;
4058240597
const filePath = process.env['GITHUB_ENV'] || '';
4058340598
if (filePath) {
40584-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
40585-
// 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.
40586-
if (name.includes(delimiter)) {
40587-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
40588-
}
40589-
if (convertedVal.includes(delimiter)) {
40590-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
40591-
}
40592-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
40593-
file_command_1.issueCommand('ENV', commandValue);
40594-
}
40595-
else {
40596-
command_1.issueCommand('set-env', { name }, convertedVal);
40599+
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
4059740600
}
40601+
command_1.issueCommand('set-env', { name }, convertedVal);
4059840602
}
4059940603
exports.exportVariable = exportVariable;
4060040604
/**
@@ -40612,7 +40616,7 @@ exports.setSecret = setSecret;
4061240616
function addPath(inputPath) {
4061340617
const filePath = process.env['GITHUB_PATH'] || '';
4061440618
if (filePath) {
40615-
file_command_1.issueCommand('PATH', inputPath);
40619+
file_command_1.issueFileCommand('PATH', inputPath);
4061640620
}
4061740621
else {
4061840622
command_1.issueCommand('add-path', {}, inputPath);
@@ -40652,7 +40656,10 @@ function getMultilineInput(name, options) {
4065240656
const inputs = getInput(name, options)
4065340657
.split('\n')
4065440658
.filter(x => x !== '');
40655-
return inputs;
40659+
if (options && options.trimWhitespace === false) {
40660+
return inputs;
40661+
}
40662+
return inputs.map(input => input.trim());
4065640663
}
4065740664
exports.getMultilineInput = getMultilineInput;
4065840665
/**
@@ -40685,8 +40692,12 @@ exports.getBooleanInput = getBooleanInput;
4068540692
*/
4068640693
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4068740694
function setOutput(name, value) {
40695+
const filePath = process.env['GITHUB_OUTPUT'] || '';
40696+
if (filePath) {
40697+
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
40698+
}
4068840699
process.stdout.write(os.EOL);
40689-
command_1.issueCommand('set-output', { name }, value);
40700+
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
4069040701
}
4069140702
exports.setOutput = setOutput;
4069240703
/**
@@ -40815,7 +40826,11 @@ exports.group = group;
4081540826
*/
4081640827
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4081740828
function saveState(name, value) {
40818-
command_1.issueCommand('save-state', { name }, value);
40829+
const filePath = process.env['GITHUB_STATE'] || '';
40830+
if (filePath) {
40831+
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
40832+
}
40833+
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
4081940834
}
4082040835
exports.saveState = saveState;
4082140836
/**

dist/save/index.js

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,13 +2954,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
29542954
return result;
29552955
};
29562956
Object.defineProperty(exports, "__esModule", { value: true });
2957-
exports.issueCommand = void 0;
2957+
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
29582958
// We use any as a valid input type
29592959
/* eslint-disable @typescript-eslint/no-explicit-any */
29602960
const fs = __importStar(__webpack_require__(747));
29612961
const os = __importStar(__webpack_require__(87));
2962+
const uuid_1 = __webpack_require__(25);
29622963
const utils_1 = __webpack_require__(82);
2963-
function issueCommand(command, message) {
2964+
function issueFileCommand(command, message) {
29642965
const filePath = process.env[`GITHUB_${command}`];
29652966
if (!filePath) {
29662967
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -2972,7 +2973,22 @@ function issueCommand(command, message) {
29722973
encoding: 'utf8'
29732974
});
29742975
}
2975-
exports.issueCommand = issueCommand;
2976+
exports.issueFileCommand = issueFileCommand;
2977+
function prepareKeyValueMessage(key, value) {
2978+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
2979+
const convertedValue = utils_1.toCommandValue(value);
2980+
// These should realistically never happen, but just in case someone finds a
2981+
// way to exploit uuid generation let's not allow keys or values that contain
2982+
// the delimiter.
2983+
if (key.includes(delimiter)) {
2984+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
2985+
}
2986+
if (convertedValue.includes(delimiter)) {
2987+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
2988+
}
2989+
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
2990+
}
2991+
exports.prepareKeyValueMessage = prepareKeyValueMessage;
29762992
//# sourceMappingURL=file-command.js.map
29772993

29782994
/***/ }),
@@ -40551,7 +40567,6 @@ const file_command_1 = __webpack_require__(102);
4055140567
const utils_1 = __webpack_require__(82);
4055240568
const os = __importStar(__webpack_require__(87));
4055340569
const path = __importStar(__webpack_require__(622));
40554-
const uuid_1 = __webpack_require__(25);
4055540570
const oidc_utils_1 = __webpack_require__(742);
4055640571
/**
4055740572
* The code to exit an action
@@ -40581,20 +40596,9 @@ function exportVariable(name, val) {
4058140596
process.env[name] = convertedVal;
4058240597
const filePath = process.env['GITHUB_ENV'] || '';
4058340598
if (filePath) {
40584-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
40585-
// 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.
40586-
if (name.includes(delimiter)) {
40587-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
40588-
}
40589-
if (convertedVal.includes(delimiter)) {
40590-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
40591-
}
40592-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
40593-
file_command_1.issueCommand('ENV', commandValue);
40594-
}
40595-
else {
40596-
command_1.issueCommand('set-env', { name }, convertedVal);
40599+
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
4059740600
}
40601+
command_1.issueCommand('set-env', { name }, convertedVal);
4059840602
}
4059940603
exports.exportVariable = exportVariable;
4060040604
/**
@@ -40612,7 +40616,7 @@ exports.setSecret = setSecret;
4061240616
function addPath(inputPath) {
4061340617
const filePath = process.env['GITHUB_PATH'] || '';
4061440618
if (filePath) {
40615-
file_command_1.issueCommand('PATH', inputPath);
40619+
file_command_1.issueFileCommand('PATH', inputPath);
4061640620
}
4061740621
else {
4061840622
command_1.issueCommand('add-path', {}, inputPath);
@@ -40652,7 +40656,10 @@ function getMultilineInput(name, options) {
4065240656
const inputs = getInput(name, options)
4065340657
.split('\n')
4065440658
.filter(x => x !== '');
40655-
return inputs;
40659+
if (options && options.trimWhitespace === false) {
40660+
return inputs;
40661+
}
40662+
return inputs.map(input => input.trim());
4065640663
}
4065740664
exports.getMultilineInput = getMultilineInput;
4065840665
/**
@@ -40685,8 +40692,12 @@ exports.getBooleanInput = getBooleanInput;
4068540692
*/
4068640693
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4068740694
function setOutput(name, value) {
40695+
const filePath = process.env['GITHUB_OUTPUT'] || '';
40696+
if (filePath) {
40697+
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
40698+
}
4068840699
process.stdout.write(os.EOL);
40689-
command_1.issueCommand('set-output', { name }, value);
40700+
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
4069040701
}
4069140702
exports.setOutput = setOutput;
4069240703
/**
@@ -40815,7 +40826,11 @@ exports.group = group;
4081540826
*/
4081640827
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4081740828
function saveState(name, value) {
40818-
command_1.issueCommand('save-state', { name }, value);
40829+
const filePath = process.env['GITHUB_STATE'] || '';
40830+
if (filePath) {
40831+
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
40832+
}
40833+
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
4081940834
}
4082040835
exports.saveState = saveState;
4082140836
/**

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"license": "MIT",
2525
"dependencies": {
2626
"@actions/cache": "^3.0.4",
27-
"@actions/core": "^1.9.1",
27+
"@actions/core": "^1.10.0",
2828
"@actions/exec": "^1.1.1",
2929
"@actions/io": "^1.1.2"
3030
},
@@ -48,4 +48,4 @@
4848
"ts-jest": "^28.0.2",
4949
"typescript": "^4.6.4"
5050
}
51-
}
51+
}

0 commit comments

Comments
 (0)