Skip to content

Commit aa231db

Browse files
author
Cole Kennedy
committed
.
1 parent 09a325f commit aa231db

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525

2626
- name: Install dependencies
2727
run: npm ci
28-
28+
2929
- name: Test wrapper with time command
3030
id: time-test
3131
uses: ./
3232
with:
3333
action-ref: "actions/hello-world-javascript-action@main"
34-
wrapper-command: "time -v"
34+
wrapper-command: "witness run -a=environment -a=github -a=slsa --attestor-slsa-export --enable-archivista=true --signer-fulcio-url=https://fulcio.sigstore.dev --signer-fulcio-oidc-client-id=sigstore --signer-fulcio-oidc-issuer=https://oauth2.sigstore.dev/auth -s=test-sigstore --timestamp-servers=https://freetsa.org/tsr --"
3535
input-who-to-greet: "Time"
3636

3737
- name: Check time output

index.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,17 @@ async function processAction(actionDir, extraArgs, repo, isWrapperEnabled, wrapp
292292

293293
core.info(`Command output will be saved to: ${wrapperLogFile}`);
294294
}
295-
296-
// Define the node command and arguments
295+
296+
297297
const nodeCmd = "node";
298-
const nodeArgs = [entryFile, ...args];
298+
const nodeArgs = [entryFile];
299+
// Create a shell command that prints the env vars (using `env`)
300+
// then runs your node command.
301+
const debugCommand = `echo '--- Debug: Environment Variables ---'; env; ${nodeCmd} ${nodeArgs.join(" ")}`;
302+
// Insert that command right in the runArray where the debug print is needed.
303+
const runArray = ["witness", ...cmd, "--", "sh", "-c", debugCommand];
304+
const commandString = runArray.join(" ");
305+
await exec.exec("sh", ["-c", commandString], { env: envVars });
299306

300307
// Execute the wrapped command
301308
let cp;

0 commit comments

Comments
 (0)