Skip to content

Commit b8544fb

Browse files
author
Cole Kennedy
committed
.
1 parent 7693711 commit b8544fb

File tree

1 file changed

+3
-37
lines changed

1 file changed

+3
-37
lines changed

index.js

+3-37
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ async function run() {
7373
const exportSLSA = core.getInput("attestor-slsa-export") === "true";
7474
const mavenPOM = core.getInput("attestor-maven-pom-path");
7575

76-
77-
78-
7976
// Step 5: Run the downloaded action with Witness
8077
const witnessOutput = await runActionWithWitness(
8178
downloadedActionDir,
@@ -313,10 +310,6 @@ async function downloadAndExtractAction(actionRef) {
313310

314311
// Run an action with Witness
315312
async function runActionWithWitness(actionDir, witnessOptions) {
316-
317-
318-
319-
// To this:
320313
let {
321314
step,
322315
archivistaServer,
@@ -342,7 +335,6 @@ async function runActionWithWitness(actionDir, witnessOptions) {
342335
mavenPOM,
343336
} = witnessOptions;
344337

345-
346338
// Read action.yml from the downloaded action
347339
const actionYmlPath = path.join(actionDir, "action.yml");
348340
// Some actions use action.yaml instead of action.yml
@@ -377,34 +369,8 @@ async function runActionWithWitness(actionDir, witnessOptions) {
377369
await exec.exec("npm", ["install"], { cwd: actionDir });
378370
}
379371

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
404373
const envVars = { ...process.env };
405-
Object.keys(nestedInputs).forEach(name => {
406-
envVars[`INPUT_${name.toUpperCase()}`] = nestedInputs[name];
407-
});
408374

409375
// Build the witness run command
410376
const cmd = ["run"];
@@ -480,7 +446,7 @@ async function runActionWithWitness(actionDir, witnessOptions) {
480446
// Set up options for execution
481447
const execOptions = {
482448
cwd: actionDir,
483-
env: process.env,
449+
env: envVars,
484450
listeners: {
485451
stdout: (data) => {
486452
process.stdout.write(data.toString());
@@ -560,4 +526,4 @@ run()
560526
core.debug('Forcing process exit to prevent hanging');
561527
process.exit(1);
562528
}, 500);
563-
});
529+
});

0 commit comments

Comments
 (0)