Skip to content

Commit

Permalink
Fix tofu output printing debug information (#31)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Masarik <[email protected]>
  • Loading branch information
VladMasarik authored Apr 25, 2024
1 parent ae80d4e commit 12f4deb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions dist/index1.js
Original file line number Diff line number Diff line change
Expand Up @@ -4210,13 +4210,14 @@ async function checkTofu () {
const args = process.argv.slice(2);
const options = {
listeners,
ignoreReturnCode: true
ignoreReturnCode: true,
silent: true // don't print "[command...]" into stdout: https://github.com/actions/toolkit/issues/649
};
const exitCode = await exec(pathToCLI, args, options);
core.debug(`OpenTofu exited with code ${exitCode}.`);
core.debug(`stdout: ${stdout.contents}`);
core.debug(`stderr: ${stderr.contents}`);
core.debug(`exitcode: ${exitCode}`);

// Pass-through stdout/err as `exec` won't due to `silent: true` option
process.stdout.write(stdout.contents);
process.stderr.write(stderr.contents);

// Set outputs, result, exitcode, and stderr
core.setOutput('stdout', stdout.contents);
Expand Down
11 changes: 6 additions & 5 deletions wrapper/tofu.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ async function checkTofu () {
const args = process.argv.slice(2);
const options = {
listeners,
ignoreReturnCode: true
ignoreReturnCode: true,
silent: true // don't print "[command...]" into stdout: https://github.com/actions/toolkit/issues/649
};
const exitCode = await exec(pathToCLI, args, options);
core.debug(`OpenTofu exited with code ${exitCode}.`);
core.debug(`stdout: ${stdout.contents}`);
core.debug(`stderr: ${stderr.contents}`);
core.debug(`exitcode: ${exitCode}`);

// Pass-through stdout/err as `exec` won't due to `silent: true` option
process.stdout.write(stdout.contents);
process.stderr.write(stderr.contents);

// Set outputs, result, exitcode, and stderr
core.setOutput('stdout', stdout.contents);
Expand Down

0 comments on commit 12f4deb

Please sign in to comment.