Skip to content

Commit ed89617

Browse files
committed
🔖 Release v1.9.8 [skip ci]
1 parent d9445c4 commit ed89617

File tree

4 files changed

+47
-24
lines changed

4 files changed

+47
-24
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [v1.9.8] - 2022-10-03
2+
3+
[Release notes](https://github.com/betahuhn/deploy-to-vercel-action/releases/tag/v1.9.8) · [Compare](https://github.com/betahuhn/deploy-to-vercel-action/compare/v1.9.7...v1.9.8) · [Tag](https://github.com/betahuhn/deploy-to-vercel-action/tree/v1.9.8) · Archive ([zip](https://github.com/betahuhn/deploy-to-vercel-action/archive/v1.9.8.zip) · [tar.gz](https://github.com/betahuhn/deploy-to-vercel-action/archive/v1.9.8.tar.gz))
4+
5+
### Dependency updates
6+
7+
- [`cf1f736`](https://github.com/betahuhn/deploy-to-vercel-action/commit/cf1f736) Bump @actions/core from 1.9.1 to 1.10.0
8+
19
## [v1.9.7] - 2022-09-19
210

311
[Release notes](https://github.com/betahuhn/deploy-to-vercel-action/releases/tag/v1.9.7) · [Compare](https://github.com/betahuhn/deploy-to-vercel-action/compare/v1.9.6...v1.9.7) · [Tag](https://github.com/betahuhn/deploy-to-vercel-action/tree/v1.9.7) · Archive ([zip](https://github.com/betahuhn/deploy-to-vercel-action/archive/v1.9.7.zip) · [tar.gz](https://github.com/betahuhn/deploy-to-vercel-action/archive/v1.9.7.tar.gz))

dist/index.js

+36-21
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ const file_command_1 = __nccwpck_require__(717);
140140
const utils_1 = __nccwpck_require__(5278);
141141
const os = __importStar(__nccwpck_require__(2037));
142142
const path = __importStar(__nccwpck_require__(1017));
143-
const uuid_1 = __nccwpck_require__(5840);
144143
const oidc_utils_1 = __nccwpck_require__(8041);
145144
/**
146145
* The code to exit an action
@@ -170,20 +169,9 @@ function exportVariable(name, val) {
170169
process.env[name] = convertedVal;
171170
const filePath = process.env['GITHUB_ENV'] || '';
172171
if (filePath) {
173-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
174-
// 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.
175-
if (name.includes(delimiter)) {
176-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
177-
}
178-
if (convertedVal.includes(delimiter)) {
179-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
180-
}
181-
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
182-
file_command_1.issueCommand('ENV', commandValue);
183-
}
184-
else {
185-
command_1.issueCommand('set-env', { name }, convertedVal);
172+
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
186173
}
174+
command_1.issueCommand('set-env', { name }, convertedVal);
187175
}
188176
exports.exportVariable = exportVariable;
189177
/**
@@ -201,7 +189,7 @@ exports.setSecret = setSecret;
201189
function addPath(inputPath) {
202190
const filePath = process.env['GITHUB_PATH'] || '';
203191
if (filePath) {
204-
file_command_1.issueCommand('PATH', inputPath);
192+
file_command_1.issueFileCommand('PATH', inputPath);
205193
}
206194
else {
207195
command_1.issueCommand('add-path', {}, inputPath);
@@ -241,7 +229,10 @@ function getMultilineInput(name, options) {
241229
const inputs = getInput(name, options)
242230
.split('\n')
243231
.filter(x => x !== '');
244-
return inputs;
232+
if (options && options.trimWhitespace === false) {
233+
return inputs;
234+
}
235+
return inputs.map(input => input.trim());
245236
}
246237
exports.getMultilineInput = getMultilineInput;
247238
/**
@@ -274,8 +265,12 @@ exports.getBooleanInput = getBooleanInput;
274265
*/
275266
// eslint-disable-next-line @typescript-eslint/no-explicit-any
276267
function setOutput(name, value) {
268+
const filePath = process.env['GITHUB_OUTPUT'] || '';
269+
if (filePath) {
270+
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
271+
}
277272
process.stdout.write(os.EOL);
278-
command_1.issueCommand('set-output', { name }, value);
273+
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
279274
}
280275
exports.setOutput = setOutput;
281276
/**
@@ -404,7 +399,11 @@ exports.group = group;
404399
*/
405400
// eslint-disable-next-line @typescript-eslint/no-explicit-any
406401
function saveState(name, value) {
407-
command_1.issueCommand('save-state', { name }, value);
402+
const filePath = process.env['GITHUB_STATE'] || '';
403+
if (filePath) {
404+
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
405+
}
406+
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
408407
}
409408
exports.saveState = saveState;
410409
/**
@@ -470,13 +469,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
470469
return result;
471470
};
472471
Object.defineProperty(exports, "__esModule", ({ value: true }));
473-
exports.issueCommand = void 0;
472+
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
474473
// We use any as a valid input type
475474
/* eslint-disable @typescript-eslint/no-explicit-any */
476475
const fs = __importStar(__nccwpck_require__(7147));
477476
const os = __importStar(__nccwpck_require__(2037));
477+
const uuid_1 = __nccwpck_require__(5840);
478478
const utils_1 = __nccwpck_require__(5278);
479-
function issueCommand(command, message) {
479+
function issueFileCommand(command, message) {
480480
const filePath = process.env[`GITHUB_${command}`];
481481
if (!filePath) {
482482
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -488,7 +488,22 @@ function issueCommand(command, message) {
488488
encoding: 'utf8'
489489
});
490490
}
491-
exports.issueCommand = issueCommand;
491+
exports.issueFileCommand = issueFileCommand;
492+
function prepareKeyValueMessage(key, value) {
493+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
494+
const convertedValue = utils_1.toCommandValue(value);
495+
// These should realistically never happen, but just in case someone finds a
496+
// way to exploit uuid generation let's not allow keys or values that contain
497+
// the delimiter.
498+
if (key.includes(delimiter)) {
499+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
500+
}
501+
if (convertedValue.includes(delimiter)) {
502+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
503+
}
504+
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
505+
}
506+
exports.prepareKeyValueMessage = prepareKeyValueMessage;
492507
//# sourceMappingURL=file-command.js.map
493508

494509
/***/ }),

package-lock.json

+2-2
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
@@ -1,6 +1,6 @@
11
{
22
"name": "deploy-to-vercel-action",
3-
"version": "1.9.7",
3+
"version": "1.9.8",
44
"description": "Deploy your project to Vercel using GitHub Actions. Supports PR previews and GitHub deployments.",
55
"main": "dist/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)