Skip to content

Commit a767bb0

Browse files
committed
chore: update dist files with npm run build
Actual command: $ docker run \ --interactive \ --rm \ --tty \ --volume ${PWD}:/var/task \ --workdir /var/task \ node:20-buster \ sh -c 'npm install -g npm@10.5.0 && yarn install && NODE_OPTIONS=--openssl-legacy-provider npm run build'
1 parent 83c3be0 commit a767bb0

File tree

2 files changed

+45
-73
lines changed

2 files changed

+45
-73
lines changed

dist/cleanup.js

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
292292
return result;
293293
};
294294
Object.defineProperty(exports, "__esModule", { value: true });
295-
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
295+
exports.issueCommand = void 0;
296296
// We use any as a valid input type
297297
/* eslint-disable @typescript-eslint/no-explicit-any */
298298
const fs = __importStar(__webpack_require__(747));
299299
const os = __importStar(__webpack_require__(87));
300-
const uuid_1 = __webpack_require__(62);
301300
const utils_1 = __webpack_require__(82);
302-
function issueFileCommand(command, message) {
301+
function issueCommand(command, message) {
303302
const filePath = process.env[`GITHUB_${command}`];
304303
if (!filePath) {
305304
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -311,22 +310,7 @@ function issueFileCommand(command, message) {
311310
encoding: 'utf8'
312311
});
313312
}
314-
exports.issueFileCommand = issueFileCommand;
315-
function prepareKeyValueMessage(key, value) {
316-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
317-
const convertedValue = utils_1.toCommandValue(value);
318-
// These should realistically never happen, but just in case someone finds a
319-
// way to exploit uuid generation let's not allow keys or values that contain
320-
// the delimiter.
321-
if (key.includes(delimiter)) {
322-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
323-
}
324-
if (convertedValue.includes(delimiter)) {
325-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
326-
}
327-
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
328-
}
329-
exports.prepareKeyValueMessage = prepareKeyValueMessage;
313+
exports.issueCommand = issueCommand;
330314
//# sourceMappingURL=file-command.js.map
331315

332316
/***/ }),
@@ -615,9 +599,11 @@ exports.debug = debug; // for test
615599

616600
const core = __webpack_require__(470);
617601
const { execFileSync } = __webpack_require__(129);
618-
const { sshAgentCmd } = __webpack_require__(972);
602+
const { sshAgentCmdDefault } = __webpack_require__(972);
619603

620604
try {
605+
const sshAgentCmdInput = core.getInput('ssh-agent-cmd');
606+
const sshAgentCmd = sshAgentCmdInput ? sshAgentCmdInput : sshAgentCmdDefault;
621607
// Kill the started SSH agent
622608
console.log('Stopping SSH agent');
623609
execFileSync(sshAgentCmd, ['-k'], { stdio: 'inherit' });
@@ -1684,6 +1670,7 @@ const file_command_1 = __webpack_require__(102);
16841670
const utils_1 = __webpack_require__(82);
16851671
const os = __importStar(__webpack_require__(87));
16861672
const path = __importStar(__webpack_require__(622));
1673+
const uuid_1 = __webpack_require__(62);
16871674
const oidc_utils_1 = __webpack_require__(742);
16881675
/**
16891676
* The code to exit an action
@@ -1713,9 +1700,20 @@ function exportVariable(name, val) {
17131700
process.env[name] = convertedVal;
17141701
const filePath = process.env['GITHUB_ENV'] || '';
17151702
if (filePath) {
1716-
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
1703+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
1704+
// 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.
1705+
if (name.includes(delimiter)) {
1706+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
1707+
}
1708+
if (convertedVal.includes(delimiter)) {
1709+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
1710+
}
1711+
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
1712+
file_command_1.issueCommand('ENV', commandValue);
1713+
}
1714+
else {
1715+
command_1.issueCommand('set-env', { name }, convertedVal);
17171716
}
1718-
command_1.issueCommand('set-env', { name }, convertedVal);
17191717
}
17201718
exports.exportVariable = exportVariable;
17211719
/**
@@ -1733,7 +1731,7 @@ exports.setSecret = setSecret;
17331731
function addPath(inputPath) {
17341732
const filePath = process.env['GITHUB_PATH'] || '';
17351733
if (filePath) {
1736-
file_command_1.issueFileCommand('PATH', inputPath);
1734+
file_command_1.issueCommand('PATH', inputPath);
17371735
}
17381736
else {
17391737
command_1.issueCommand('add-path', {}, inputPath);
@@ -1773,10 +1771,7 @@ function getMultilineInput(name, options) {
17731771
const inputs = getInput(name, options)
17741772
.split('\n')
17751773
.filter(x => x !== '');
1776-
if (options && options.trimWhitespace === false) {
1777-
return inputs;
1778-
}
1779-
return inputs.map(input => input.trim());
1774+
return inputs;
17801775
}
17811776
exports.getMultilineInput = getMultilineInput;
17821777
/**
@@ -1809,12 +1804,8 @@ exports.getBooleanInput = getBooleanInput;
18091804
*/
18101805
// eslint-disable-next-line @typescript-eslint/no-explicit-any
18111806
function setOutput(name, value) {
1812-
const filePath = process.env['GITHUB_OUTPUT'] || '';
1813-
if (filePath) {
1814-
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
1815-
}
18161807
process.stdout.write(os.EOL);
1817-
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
1808+
command_1.issueCommand('set-output', { name }, value);
18181809
}
18191810
exports.setOutput = setOutput;
18201811
/**
@@ -1943,11 +1934,7 @@ exports.group = group;
19431934
*/
19441935
// eslint-disable-next-line @typescript-eslint/no-explicit-any
19451936
function saveState(name, value) {
1946-
const filePath = process.env['GITHUB_STATE'] || '';
1947-
if (filePath) {
1948-
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
1949-
}
1950-
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
1937+
command_1.issueCommand('save-state', { name }, value);
19511938
}
19521939
exports.saveState = saveState;
19531940
/**

dist/index.js

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
292292
return result;
293293
};
294294
Object.defineProperty(exports, "__esModule", { value: true });
295-
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
295+
exports.issueCommand = void 0;
296296
// We use any as a valid input type
297297
/* eslint-disable @typescript-eslint/no-explicit-any */
298298
const fs = __importStar(__webpack_require__(747));
299299
const os = __importStar(__webpack_require__(87));
300-
const uuid_1 = __webpack_require__(62);
301300
const utils_1 = __webpack_require__(82);
302-
function issueFileCommand(command, message) {
301+
function issueCommand(command, message) {
303302
const filePath = process.env[`GITHUB_${command}`];
304303
if (!filePath) {
305304
throw new Error(`Unable to find environment variable for file command ${command}`);
@@ -311,22 +310,7 @@ function issueFileCommand(command, message) {
311310
encoding: 'utf8'
312311
});
313312
}
314-
exports.issueFileCommand = issueFileCommand;
315-
function prepareKeyValueMessage(key, value) {
316-
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
317-
const convertedValue = utils_1.toCommandValue(value);
318-
// These should realistically never happen, but just in case someone finds a
319-
// way to exploit uuid generation let's not allow keys or values that contain
320-
// the delimiter.
321-
if (key.includes(delimiter)) {
322-
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
323-
}
324-
if (convertedValue.includes(delimiter)) {
325-
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
326-
}
327-
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
328-
}
329-
exports.prepareKeyValueMessage = prepareKeyValueMessage;
313+
exports.issueCommand = issueCommand;
330314
//# sourceMappingURL=file-command.js.map
331315

332316
/***/ }),
@@ -1765,6 +1749,7 @@ const file_command_1 = __webpack_require__(102);
17651749
const utils_1 = __webpack_require__(82);
17661750
const os = __importStar(__webpack_require__(87));
17671751
const path = __importStar(__webpack_require__(622));
1752+
const uuid_1 = __webpack_require__(62);
17681753
const oidc_utils_1 = __webpack_require__(742);
17691754
/**
17701755
* The code to exit an action
@@ -1794,9 +1779,20 @@ function exportVariable(name, val) {
17941779
process.env[name] = convertedVal;
17951780
const filePath = process.env['GITHUB_ENV'] || '';
17961781
if (filePath) {
1797-
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
1782+
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
1783+
// 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.
1784+
if (name.includes(delimiter)) {
1785+
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
1786+
}
1787+
if (convertedVal.includes(delimiter)) {
1788+
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
1789+
}
1790+
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
1791+
file_command_1.issueCommand('ENV', commandValue);
1792+
}
1793+
else {
1794+
command_1.issueCommand('set-env', { name }, convertedVal);
17981795
}
1799-
command_1.issueCommand('set-env', { name }, convertedVal);
18001796
}
18011797
exports.exportVariable = exportVariable;
18021798
/**
@@ -1814,7 +1810,7 @@ exports.setSecret = setSecret;
18141810
function addPath(inputPath) {
18151811
const filePath = process.env['GITHUB_PATH'] || '';
18161812
if (filePath) {
1817-
file_command_1.issueFileCommand('PATH', inputPath);
1813+
file_command_1.issueCommand('PATH', inputPath);
18181814
}
18191815
else {
18201816
command_1.issueCommand('add-path', {}, inputPath);
@@ -1854,10 +1850,7 @@ function getMultilineInput(name, options) {
18541850
const inputs = getInput(name, options)
18551851
.split('\n')
18561852
.filter(x => x !== '');
1857-
if (options && options.trimWhitespace === false) {
1858-
return inputs;
1859-
}
1860-
return inputs.map(input => input.trim());
1853+
return inputs;
18611854
}
18621855
exports.getMultilineInput = getMultilineInput;
18631856
/**
@@ -1890,12 +1883,8 @@ exports.getBooleanInput = getBooleanInput;
18901883
*/
18911884
// eslint-disable-next-line @typescript-eslint/no-explicit-any
18921885
function setOutput(name, value) {
1893-
const filePath = process.env['GITHUB_OUTPUT'] || '';
1894-
if (filePath) {
1895-
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
1896-
}
18971886
process.stdout.write(os.EOL);
1898-
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
1887+
command_1.issueCommand('set-output', { name }, value);
18991888
}
19001889
exports.setOutput = setOutput;
19011890
/**
@@ -2024,11 +2013,7 @@ exports.group = group;
20242013
*/
20252014
// eslint-disable-next-line @typescript-eslint/no-explicit-any
20262015
function saveState(name, value) {
2027-
const filePath = process.env['GITHUB_STATE'] || '';
2028-
if (filePath) {
2029-
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
2030-
}
2031-
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
2016+
command_1.issueCommand('save-state', { name }, value);
20322017
}
20332018
exports.saveState = saveState;
20342019
/**

0 commit comments

Comments
 (0)