@@ -292,14 +292,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
292292 return result ;
293293} ;
294294Object . 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 */
298298const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
299299const os = __importStar ( __webpack_require__ ( 87 ) ) ;
300- const uuid_1 = __webpack_require__ ( 62 ) ;
301300const 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
616600const core = __webpack_require__ ( 470 ) ;
617601const { execFileSync } = __webpack_require__ ( 129 ) ;
618- const { sshAgentCmd } = __webpack_require__ ( 972 ) ;
602+ const { sshAgentCmdDefault } = __webpack_require__ ( 972 ) ;
619603
620604try {
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);
16841670const utils_1 = __webpack_require__ ( 82 ) ;
16851671const os = __importStar ( __webpack_require__ ( 87 ) ) ;
16861672const path = __importStar ( __webpack_require__ ( 622 ) ) ;
1673+ const uuid_1 = __webpack_require__ ( 62 ) ;
16871674const 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}
17201718exports . exportVariable = exportVariable ;
17211719/**
@@ -1733,7 +1731,7 @@ exports.setSecret = setSecret;
17331731function 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}
17811776exports . getMultilineInput = getMultilineInput ;
17821777/**
@@ -1809,12 +1804,8 @@ exports.getBooleanInput = getBooleanInput;
18091804 */
18101805// eslint-disable-next-line @typescript-eslint/no-explicit-any
18111806function 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}
18191810exports . setOutput = setOutput ;
18201811/**
@@ -1943,11 +1934,7 @@ exports.group = group;
19431934 */
19441935// eslint-disable-next-line @typescript-eslint/no-explicit-any
19451936function 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}
19521939exports . saveState = saveState ;
19531940/**
0 commit comments