@@ -73,9 +73,6 @@ async function run() {
73
73
const exportSLSA = core . getInput ( "attestor-slsa-export" ) === "true" ;
74
74
const mavenPOM = core . getInput ( "attestor-maven-pom-path" ) ;
75
75
76
-
77
-
78
-
79
76
// Step 5: Run the downloaded action with Witness
80
77
const witnessOutput = await runActionWithWitness (
81
78
downloadedActionDir ,
@@ -313,10 +310,6 @@ async function downloadAndExtractAction(actionRef) {
313
310
314
311
// Run an action with Witness
315
312
async function runActionWithWitness ( actionDir , witnessOptions ) {
316
-
317
-
318
-
319
- // To this:
320
313
let {
321
314
step,
322
315
archivistaServer,
@@ -342,7 +335,6 @@ async function runActionWithWitness(actionDir, witnessOptions) {
342
335
mavenPOM,
343
336
} = witnessOptions ;
344
337
345
-
346
338
// Read action.yml from the downloaded action
347
339
const actionYmlPath = path . join ( actionDir , "action.yml" ) ;
348
340
// Some actions use action.yaml instead of action.yml
@@ -377,34 +369,8 @@ async function runActionWithWitness(actionDir, witnessOptions) {
377
369
await exec . exec ( "npm" , [ "install" ] , { cwd : actionDir } ) ;
378
370
}
379
371
380
- // Get all inputs with 'input-' prefix and pass them to the nested action
381
- // We'll set these as environment variables that GitHub Actions uses
382
- const inputPrefix = 'input-' ;
383
- const nestedInputs = { } ;
384
-
385
- //log all the inputs
386
- Object . keys ( process . env ) . forEach ( key => {
387
- core . info ( `Key: ${ key } , Value: ${ process . env [ key ] } ` ) ;
388
- }
389
- ) ;
390
-
391
- // Get all inputs that start with 'input-'
392
- Object . keys ( process . env )
393
- . filter ( key => key . startsWith ( 'INPUT_' ) )
394
- . forEach ( key => {
395
- const inputName = key . substring ( 6 ) . toLowerCase ( ) ; // Remove 'INPUT_' prefix
396
- if ( inputName . startsWith ( inputPrefix ) ) {
397
- const nestedInputName = inputName . substring ( inputPrefix . length ) ;
398
- nestedInputs [ nestedInputName ] = process . env [ key ] ;
399
- core . info ( `Passing input '${ nestedInputName } ' to nested action` ) ;
400
- }
401
- } ) ;
402
-
403
- // Set environment variables for the nested action
372
+ // Instead of filtering, pass all environment variables to the nested action
404
373
const envVars = { ...process . env } ;
405
- Object . keys ( nestedInputs ) . forEach ( name => {
406
- envVars [ `INPUT_${ name . toUpperCase ( ) } ` ] = nestedInputs [ name ] ;
407
- } ) ;
408
374
409
375
// Build the witness run command
410
376
const cmd = [ "run" ] ;
@@ -480,7 +446,7 @@ async function runActionWithWitness(actionDir, witnessOptions) {
480
446
// Set up options for execution
481
447
const execOptions = {
482
448
cwd : actionDir ,
483
- env : process . env ,
449
+ env : envVars ,
484
450
listeners : {
485
451
stdout : ( data ) => {
486
452
process . stdout . write ( data . toString ( ) ) ;
@@ -560,4 +526,4 @@ run()
560
526
core . debug ( 'Forcing process exit to prevent hanging' ) ;
561
527
process . exit ( 1 ) ;
562
528
} , 500 ) ;
563
- } ) ;
529
+ } ) ;
0 commit comments