diff --git a/dist/index1.js b/dist/index1.js index 73147cfd..828854f7 100755 --- a/dist/index1.js +++ b/dist/index1.js @@ -4176,9 +4176,15 @@ async function checkTerraform () { const args = process.argv.slice(2); const options = { listeners, - ignoreReturnCode: true + ignoreReturnCode: true, + silent: true, // workaround github.com/actions/toolkit#649 }; const exitCode = await exec(pathToCLI, args, options); + + // Pass-through stdout/err as `exec` won't due to `silent: true` option + process.stdout.write(stdout.contents); + process.stderr.write(stderr.contents); + core.debug(`Terraform exited with code ${exitCode}.`); core.debug(`stdout: ${stdout.contents}`); core.debug(`stderr: ${stderr.contents}`); diff --git a/wrapper/terraform.js b/wrapper/terraform.js index eddcb35f..9a031521 100755 --- a/wrapper/terraform.js +++ b/wrapper/terraform.js @@ -33,9 +33,15 @@ async function checkTerraform () { const args = process.argv.slice(2); const options = { listeners, - ignoreReturnCode: true + ignoreReturnCode: true, + silent: true, // workaround github.com/actions/toolkit#649 }; const exitCode = await exec(pathToCLI, args, options); + + // Pass-through stdout/err as `exec` won't due to `silent: true` option + process.stdout.write(stdout.contents); + process.stderr.write(stderr.contents); + core.debug(`Terraform exited with code ${exitCode}.`); core.debug(`stdout: ${stdout.contents}`); core.debug(`stderr: ${stderr.contents}`); @@ -46,6 +52,7 @@ async function checkTerraform () { core.setOutput('stderr', stderr.contents); core.setOutput('exitcode', exitCode.toString(10)); + if (exitCode === 0 || exitCode === 2) { // A exitCode of 0 is considered a success // An exitCode of 2 may be returned when the '-detailed-exitcode' option