Skip to content

Commit e60b80e

Browse files
committed
Debug log command output when it fails
1 parent 4735a96 commit e60b80e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dist/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35041,10 +35041,12 @@ function wrapExecutor(wrapped) {
3504135041
core.debug(`Executing: ${commandStr}`);
3504235042
const exitCode = await wrapped(command, args, opts);
3504335043
core.debug(`Command '${commandStr}' terminated with exit code ${exitCode}`);
35044+
const result = { exitCode, stdOut, stdErr };
35045+
core.debug(JSON.stringify(result));
3504435046
if (!(options?.ignoreReturnCode ?? true) && exitCode !== 0) {
3504535047
throw new Error(`Command '${commandStr}' failed with exit code ${exitCode}`);
3504635048
}
35047-
return { exitCode, stdOut, stdErr };
35049+
return result;
3504835050
};
3504935051
}
3505035052

src/exec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ export function wrapExecutor(wrapped: typeof exec.exec): CommandExecutor {
3232
core.debug(`Executing: ${commandStr}`);
3333
const exitCode = await wrapped(command, args, opts);
3434
core.debug(`Command '${commandStr}' terminated with exit code ${exitCode}`);
35+
const result = { exitCode, stdOut, stdErr };
36+
core.debug(JSON.stringify(result));
3537
if (!(options?.ignoreReturnCode ?? true) && exitCode !== 0) {
3638
throw new Error(`Command '${commandStr}' failed with exit code ${exitCode}`);
3739
}
38-
return { exitCode, stdOut, stdErr };
40+
return result;
3941
}
4042
}

0 commit comments

Comments
 (0)