@@ -292,14 +292,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
292
292
return result ;
293
293
} ;
294
294
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
295
- exports . prepareKeyValueMessage = exports . issueFileCommand = void 0 ;
295
+ exports . issueCommand = void 0 ;
296
296
// We use any as a valid input type
297
297
/* eslint-disable @typescript-eslint/no-explicit-any */
298
298
const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
299
299
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
300
- const uuid_1 = __webpack_require__ ( 62 ) ;
301
300
const utils_1 = __webpack_require__ ( 82 ) ;
302
- function issueFileCommand ( command , message ) {
301
+ function issueCommand ( command , message ) {
303
302
const filePath = process . env [ `GITHUB_${ command } ` ] ;
304
303
if ( ! filePath ) {
305
304
throw new Error ( `Unable to find environment variable for file command ${ command } ` ) ;
@@ -311,22 +310,7 @@ function issueFileCommand(command, message) {
311
310
encoding : 'utf8'
312
311
} ) ;
313
312
}
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 ;
330
314
//# sourceMappingURL=file-command.js.map
331
315
332
316
/***/ } ) ,
@@ -615,9 +599,11 @@ exports.debug = debug; // for test
615
599
616
600
const core = __webpack_require__ ( 470 ) ;
617
601
const { execFileSync } = __webpack_require__ ( 129 ) ;
618
- const { sshAgentCmd } = __webpack_require__ ( 972 ) ;
602
+ const { sshAgentCmdDefault } = __webpack_require__ ( 972 ) ;
619
603
620
604
try {
605
+ const sshAgentCmdInput = core . getInput ( 'ssh-agent-cmd' ) ;
606
+ const sshAgentCmd = sshAgentCmdInput ? sshAgentCmdInput : sshAgentCmdDefault ;
621
607
// Kill the started SSH agent
622
608
console . log ( 'Stopping SSH agent' ) ;
623
609
execFileSync ( sshAgentCmd , [ '-k' ] , { stdio : 'inherit' } ) ;
@@ -1684,6 +1670,7 @@ const file_command_1 = __webpack_require__(102);
1684
1670
const utils_1 = __webpack_require__ ( 82 ) ;
1685
1671
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
1686
1672
const path = __importStar ( __webpack_require__ ( 622 ) ) ;
1673
+ const uuid_1 = __webpack_require__ ( 62 ) ;
1687
1674
const oidc_utils_1 = __webpack_require__ ( 742 ) ;
1688
1675
/**
1689
1676
* The code to exit an action
@@ -1713,9 +1700,20 @@ function exportVariable(name, val) {
1713
1700
process . env [ name ] = convertedVal ;
1714
1701
const filePath = process . env [ 'GITHUB_ENV' ] || '' ;
1715
1702
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 ) ;
1717
1716
}
1718
- command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
1719
1717
}
1720
1718
exports . exportVariable = exportVariable ;
1721
1719
/**
@@ -1733,7 +1731,7 @@ exports.setSecret = setSecret;
1733
1731
function addPath ( inputPath ) {
1734
1732
const filePath = process . env [ 'GITHUB_PATH' ] || '' ;
1735
1733
if ( filePath ) {
1736
- file_command_1 . issueFileCommand ( 'PATH' , inputPath ) ;
1734
+ file_command_1 . issueCommand ( 'PATH' , inputPath ) ;
1737
1735
}
1738
1736
else {
1739
1737
command_1 . issueCommand ( 'add-path' , { } , inputPath ) ;
@@ -1773,10 +1771,7 @@ function getMultilineInput(name, options) {
1773
1771
const inputs = getInput ( name , options )
1774
1772
. split ( '\n' )
1775
1773
. filter ( x => x !== '' ) ;
1776
- if ( options && options . trimWhitespace === false ) {
1777
- return inputs ;
1778
- }
1779
- return inputs . map ( input => input . trim ( ) ) ;
1774
+ return inputs ;
1780
1775
}
1781
1776
exports . getMultilineInput = getMultilineInput ;
1782
1777
/**
@@ -1809,12 +1804,8 @@ exports.getBooleanInput = getBooleanInput;
1809
1804
*/
1810
1805
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1811
1806
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
- }
1816
1807
process . stdout . write ( os . EOL ) ;
1817
- command_1 . issueCommand ( 'set-output' , { name } , utils_1 . toCommandValue ( value ) ) ;
1808
+ command_1 . issueCommand ( 'set-output' , { name } , value ) ;
1818
1809
}
1819
1810
exports . setOutput = setOutput ;
1820
1811
/**
@@ -1943,11 +1934,7 @@ exports.group = group;
1943
1934
*/
1944
1935
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1945
1936
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 ) ;
1951
1938
}
1952
1939
exports . saveState = saveState ;
1953
1940
/**
0 commit comments