@@ -215,11 +215,13 @@ var ExitCode;
215215/**
216216 * Sets env variable for this action and future actions in the job
217217 * @param name the name of the variable to set
218- * @param val the value of the variable
218+ * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
219219 */
220+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
220221function exportVariable ( name , val ) {
221- process . env [ name ] = val ;
222- command_1 . issueCommand ( 'set-env' , { name } , val ) ;
222+ const convertedVal = command_1 . toCommandValue ( val ) ;
223+ process . env [ name ] = convertedVal ;
224+ command_1 . issueCommand ( 'set-env' , { name } , convertedVal ) ;
223225}
224226exports . exportVariable = exportVariable ;
225227/**
@@ -258,12 +260,22 @@ exports.getInput = getInput;
258260 * Sets the value of an output.
259261 *
260262 * @param name name of the output to set
261- * @param value value to store
263+ * @param value value to store. Non-string values will be converted to a string via JSON.stringify
262264 */
265+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
263266function setOutput ( name , value ) {
264267 command_1 . issueCommand ( 'set-output' , { name } , value ) ;
265268}
266269exports . setOutput = setOutput ;
270+ /**
271+ * Enables or disables the echoing of commands into stdout for the rest of the step.
272+ * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
273+ *
274+ */
275+ function setCommandEcho ( enabled ) {
276+ command_1 . issue ( 'echo' , enabled ? 'on' : 'off' ) ;
277+ }
278+ exports . setCommandEcho = setCommandEcho ;
267279//-----------------------------------------------------------------------
268280// Results
269281//-----------------------------------------------------------------------
@@ -297,18 +309,18 @@ function debug(message) {
297309exports . debug = debug ;
298310/**
299311 * Adds an error issue
300- * @param message error issue message
312+ * @param message error issue message. Errors will be converted to string via toString()
301313 */
302314function error ( message ) {
303- command_1 . issue ( 'error' , message ) ;
315+ command_1 . issue ( 'error' , message instanceof Error ? message . toString ( ) : message ) ;
304316}
305317exports . error = error ;
306318/**
307319 * Adds an warning issue
308- * @param message warning issue message
320+ * @param message warning issue message. Errors will be converted to string via toString()
309321 */
310322function warning ( message ) {
311- command_1 . issue ( 'warning' , message ) ;
323+ command_1 . issue ( 'warning' , message instanceof Error ? message . toString ( ) : message ) ;
312324}
313325exports . warning = warning ;
314326/**
@@ -366,8 +378,9 @@ exports.group = group;
366378 * Saves state for current action, the state can only be retrieved by this action's post job execution.
367379 *
368380 * @param name name of the state to store
369- * @param value value to store
381+ * @param value value to store. Non-string values will be converted to a string via JSON.stringify
370382 */
383+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
371384function saveState ( name , value ) {
372385 command_1 . issueCommand ( 'save-state' , { name } , value ) ;
373386}
@@ -601,8 +614,8 @@ const openssl = async () => {
601614 execSync ( `pacman.exe -R --noconfirm --noprogressbar ${ pre . trim ( ) } openssl` )
602615 execSync ( `pacman.exe -Udd --noconfirm --noprogressbar ${ fn } ` )
603616 grpEnd ( msSt )
617+ mingw = mingw . replace ( / \b o p e n s s l \b / gi, '' ) . trim ( )
604618 }
605- mingw = mingw . replace ( / \b o p e n s s l \b / gi, '' ) . trim ( )
606619}
607620
608621// Updates MSYS2 MinGW gcc items
@@ -811,14 +824,28 @@ class Command {
811824 return cmdStr ;
812825 }
813826}
827+ /**
828+ * Sanitizes an input into a string so it can be passed into issueCommand safely
829+ * @param input input to sanitize into a string
830+ */
831+ function toCommandValue ( input ) {
832+ if ( input === null || input === undefined ) {
833+ return '' ;
834+ }
835+ else if ( typeof input === 'string' || input instanceof String ) {
836+ return input ;
837+ }
838+ return JSON . stringify ( input ) ;
839+ }
840+ exports . toCommandValue = toCommandValue ;
814841function escapeData ( s ) {
815- return ( s || '' )
842+ return toCommandValue ( s )
816843 . replace ( / % / g, '%25' )
817844 . replace ( / \r / g, '%0D' )
818845 . replace ( / \n / g, '%0A' ) ;
819846}
820847function escapeProperty ( s ) {
821- return ( s || '' )
848+ return toCommandValue ( s )
822849 . replace ( / % / g, '%25' )
823850 . replace ( / \r / g, '%0D' )
824851 . replace ( / \n / g, '%0A' )
@@ -1724,14 +1751,16 @@ module.exports = require("fs");
17241751
17251752 if ( core . getInput ( 'ruby-version' ) !== '' ) {
17261753 const fn = `${ process . env . RUNNER_TEMP } \\setup_ruby.js`
1727- common . log ( ` Running ruby/setup-ruby ${ common . version } ` )
1754+ common . log ( ' Running ruby/setup-ruby' )
17281755 const msSt = performance . now ( )
17291756 await common . download ( 'https://raw.githubusercontent.com/ruby/setup-ruby/v1/dist/index.js' , fn , false )
17301757 await require ( fn ) . run ( )
17311758 const timeStr = ( ( performance . now ( ) - msSt ) / 1000 ) . toFixed ( 2 ) . padStart ( 6 )
17321759 console . log ( ` took ${ timeStr } s` )
17331760 }
17341761
1762+ common . log ( ` Running MSP-Greg/setup-ruby-pkgs ${ common . version } ` )
1763+
17351764 let runner
17361765
17371766 core . exportVariable ( 'TMPDIR' , process . env . RUNNER_TEMP )
0 commit comments