@@ -149,7 +149,30 @@ async function processAction(actionDir, extraArgs) {
149149 await exec . exec ( "npm" , [ "install" ] , { cwd : actionDir } ) ;
150150 }
151151
152- // Execute the nested action using Node.js
152+ // Get all inputs with 'input-' prefix and pass them to the nested action
153+ // We'll set these as environment variables that GitHub Actions uses
154+ const inputPrefix = 'input-' ;
155+ const nestedInputs = { } ;
156+
157+ // Get all inputs that start with 'input-'
158+ Object . keys ( process . env )
159+ . filter ( key => key . startsWith ( 'INPUT_' ) )
160+ . forEach ( key => {
161+ const inputName = key . substring ( 6 ) . toLowerCase ( ) ; // Remove 'INPUT_' prefix
162+ if ( inputName . startsWith ( inputPrefix ) ) {
163+ const nestedInputName = inputName . substring ( inputPrefix . length ) ;
164+ nestedInputs [ nestedInputName ] = process . env [ key ] ;
165+ core . info ( `Passing input '${ nestedInputName } ' to nested action` ) ;
166+ }
167+ } ) ;
168+
169+ // Set environment variables for the nested action
170+ const envVars = { ...process . env } ;
171+ Object . keys ( nestedInputs ) . forEach ( name => {
172+ envVars [ `INPUT_${ name . toUpperCase ( ) } ` ] = nestedInputs [ name ] ;
173+ } ) ;
174+
175+ // For backwards compatibility, also support the extra-args parameter
153176 const args = extraArgs . split ( / \s + / ) . filter ( ( a ) => a ) ; // split and remove empty strings
154177
155178 // Use strace if enabled and available
@@ -174,7 +197,10 @@ async function processAction(actionDir, extraArgs) {
174197 }
175198
176199 // Use strace to wrap the node process
177- await exec . exec ( "strace" , [ ...straceOptionsList , "node" , entryFile , ...args ] , { cwd : actionDir } ) ;
200+ await exec . exec ( "strace" , [ ...straceOptionsList , "node" , entryFile , ...args ] , {
201+ cwd : actionDir ,
202+ env : envVars
203+ } ) ;
178204
179205 // Export the strace log path as an output
180206 core . setOutput ( "strace-log" , stracelLogFile ) ;
@@ -183,12 +209,18 @@ async function processAction(actionDir, extraArgs) {
183209 // If strace is not available, fall back to running without it
184210 core . warning ( `Strace is not available: ${ error . message } ` ) ;
185211 core . info ( `Executing nested action without strace: node ${ entryFile } ${ args . join ( " " ) } ` ) ;
186- await exec . exec ( "node" , [ entryFile , ...args ] , { cwd : actionDir } ) ;
212+ await exec . exec ( "node" , [ entryFile , ...args ] , {
213+ cwd : actionDir ,
214+ env : envVars
215+ } ) ;
187216 }
188217 } else {
189218 // Run without strace
190219 core . info ( `Strace disabled. Executing nested action: node ${ entryFile } ${ args . join ( " " ) } ` ) ;
191- await exec . exec ( "node" , [ entryFile , ...args ] , { cwd : actionDir } ) ;
220+ await exec . exec ( "node" , [ entryFile , ...args ] , {
221+ cwd : actionDir ,
222+ env : envVars
223+ } ) ;
192224 }
193225}
194226
0 commit comments