Skip to content

Commit e5897b3

Browse files
authored
@actions/core to 1.10.0, v1.32.3 (#25)
1 parent 6c7ccc4 commit e5897b3

File tree

4 files changed

+50
-35
lines changed

4 files changed

+50
-35
lines changed

dist/index.js

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,6 @@ const file_command_1 = __nccwpck_require__(717);
815815
const utils_1 = __nccwpck_require__(278);
816816
const os = __importStar(__nccwpck_require__(37));
817817
const path = __importStar(__nccwpck_require__(17));
818-
const uuid_1 = __nccwpck_require__(840);
819818
const oidc_utils_1 = __nccwpck_require__(41);
820819
/**
821820
* The code to exit an action
@@ -845,20 +844,9 @@ function exportVariable(name, val) {
845844
process.env[name] = convertedVal;
846845
const filePath = process.env['GITHUB_ENV'] || '';
847846
if (filePath) {
848-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
849-
// 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.
850-
if (name.includes(delimiter)) {
851-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
852-
}
853-
if (convertedVal.includes(delimiter)) {
854-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
855-
}
856-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
857-
file_command_1.issueCommand('ENV', commandValue);
858-
}
859-
else {
860-
command_1.issueCommand('set-env', { name }, convertedVal);
847+
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
861848
}
849+
command_1.issueCommand('set-env', { name }, convertedVal);
862850
}
863851
exports.exportVariable = exportVariable;
864852
/**
@@ -876,7 +864,7 @@ exports.setSecret = setSecret;
876864
function addPath(inputPath) {
877865
const filePath = process.env['GITHUB_PATH'] || '';
878866
if (filePath) {
879-
file_command_1.issueCommand('PATH', inputPath);
867+
file_command_1.issueFileCommand('PATH', inputPath);
880868
}
881869
else {
882870
command_1.issueCommand('add-path', {}, inputPath);
@@ -916,7 +904,10 @@ function getMultilineInput(name, options) {
916904
const inputs = getInput(name, options)
917905
.split('\n')
918906
.filter(x => x !== '');
919-
return inputs;
907+
if (options && options.trimWhitespace === false) {
908+
return inputs;
909+
}
910+
return inputs.map(input => input.trim());
920911
}
921912
exports.getMultilineInput = getMultilineInput;
922913
/**
@@ -949,8 +940,12 @@ exports.getBooleanInput = getBooleanInput;
949940
*/
950941
// eslint-disable-next-line @typescript-eslint/no-explicit-any
951942
function setOutput(name, value) {
943+
const filePath = process.env['GITHUB_OUTPUT'] || '';
944+
if (filePath) {
945+
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
946+
}
952947
process.stdout.write(os.EOL);
953-
command_1.issueCommand('set-output', { name }, value);
948+
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
954949
}
955950
exports.setOutput = setOutput;
956951
/**
@@ -1079,7 +1074,11 @@ exports.group = group;
10791074
*/
10801075
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10811076
function saveState(name, value) {
1082-
command_1.issueCommand('save-state', { name }, value);
1077+
const filePath = process.env['GITHUB_STATE'] || '';
1078+
if (filePath) {
1079+
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
1080+
}
1081+
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
10831082
}
10841083
exports.saveState = saveState;
10851084
/**
@@ -1145,13 +1144,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
11451144
return result;
11461145
};
11471146
Object.defineProperty(exports, "__esModule", ({ value: true }));
1148-
exports.issueCommand = void 0;
1147+
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
11491148
// We use any as a valid input type
11501149
/* eslint-disable @typescript-eslint/no-explicit-any */
11511150
const fs = __importStar(__nccwpck_require__(147));
11521151
const os = __importStar(__nccwpck_require__(37));
1152+
const uuid_1 = __nccwpck_require__(840);
11531153
const utils_1 = __nccwpck_require__(278);
1154-
function issueCommand(command, message) {
1154+
function issueFileCommand(command, message) {
11551155
const filePath = process.env[`GITHUB_${command}`];
11561156
if (!filePath) {
11571157
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -1163,7 +1163,22 @@ function issueCommand(command, message) {
11631163
encoding: 'utf8'
11641164
});
11651165
}
1166-
exports.issueCommand = issueCommand;
1166+
exports.issueFileCommand = issueFileCommand;
1167+
function prepareKeyValueMessage(key, value) {
1168+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
1169+
const convertedValue = utils_1.toCommandValue(value);
1170+
// These should realistically never happen, but just in case someone finds a
1171+
// way to exploit uuid generation let's not allow keys or values that contain
1172+
// the delimiter.
1173+
if (key.includes(delimiter)) {
1174+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
1175+
}
1176+
if (convertedValue.includes(delimiter)) {
1177+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
1178+
}
1179+
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
1180+
}
1181+
exports.prepareKeyValueMessage = prepareKeyValueMessage;
11671182
//# sourceMappingURL=file-command.js.map
11681183

11691184
/***/ }),

dist/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "setup-ruby-pkgs",
3-
"version": "1.32.2",
3+
"version": "1.32.3",
44
"description": "Install packages and update builds tools for Ruby",
55
"main": "index.js",
66
"scripts": {
@@ -23,10 +23,10 @@
2323
"author": "MSP-Greg",
2424
"license": "MIT",
2525
"dependencies": {
26-
"@actions/core": "^1.9.1",
26+
"@actions/core": "^1.10.0",
2727
"@actions/http-client": "^2.0.1"
2828
},
2929
"devDependencies": {
30-
"@vercel/ncc": "^0.33.4"
30+
"@vercel/ncc": "^0.34.0"
3131
}
3232
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "setup-ruby-pkgs",
3-
"version": "1.32.2",
3+
"version": "1.32.3",
44
"description": "Install packages and update builds tools for Ruby",
55
"main": "index.js",
66
"scripts": {
@@ -23,10 +23,10 @@
2323
"author": "MSP-Greg",
2424
"license": "MIT",
2525
"dependencies": {
26-
"@actions/core": "^1.9.1",
26+
"@actions/core": "^1.10.0",
2727
"@actions/http-client": "^2.0.1"
2828
},
2929
"devDependencies": {
30-
"@vercel/ncc": "^0.33.4"
30+
"@vercel/ncc": "^0.34.0"
3131
}
3232
}

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# yarn lockfile v1
33

44

5-
"@actions/core@^1.9.1":
6-
version "1.9.1"
7-
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.9.1.tgz#97c0201b1f9856df4f7c3a375cdcdb0c2a2f750b"
8-
integrity sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==
5+
"@actions/core@^1.10.0":
6+
version "1.10.0"
7+
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.0.tgz#44551c3c71163949a2f06e94d9ca2157a0cfac4f"
8+
integrity sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==
99
dependencies:
1010
"@actions/http-client" "^2.0.1"
1111
uuid "^8.3.2"
@@ -17,10 +17,10 @@
1717
dependencies:
1818
tunnel "^0.0.6"
1919

20-
"@vercel/ncc@^0.33.4":
21-
version "0.33.4"
22-
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.33.4.tgz#e44a87511f583b7ba88e4b9ae90eeb7ba252b872"
23-
integrity sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==
20+
"@vercel/ncc@^0.34.0":
21+
version "0.34.0"
22+
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.34.0.tgz#d0139528320e46670d949c82967044a8f66db054"
23+
integrity sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==
2424

2525
tunnel@^0.0.6:
2626
version "0.0.6"

0 commit comments

Comments
 (0)