diff --git a/dist/index1.js b/dist/index1.js index c6f4bdd..9f83c9f 100755 --- a/dist/index1.js +++ b/dist/index1.js @@ -27973,7 +27973,8 @@ async function checkTerraform () { core.setOutput('stderr', stderr.contents); core.setOutput('exitcode', exitCode.toString(10)); - if (exitCode === 0 || exitCode === 2) { + const usingDetailedExitcode = args.filter(arg => arg.toLowerCase().endsWith('-detailed-exitcode')).length > 0; + if (exitCode === 0 || (exitCode === 2 && usingDetailedExitcode)) { // A exitCode of 0 is considered a success // An exitCode of 2 may be returned when the '-detailed-exitcode' option // is passed to plan. This denotes Success with non-empty diff --git a/wrapper/terraform.js b/wrapper/terraform.js index 7350dc4..a3291f4 100755 --- a/wrapper/terraform.js +++ b/wrapper/terraform.js @@ -43,7 +43,8 @@ async function checkTerraform () { core.setOutput('stderr', stderr.contents); core.setOutput('exitcode', exitCode.toString(10)); - if (exitCode === 0 || exitCode === 2) { + const usingDetailedExitcode = args.filter(arg => arg.toLowerCase().endsWith('-detailed-exitcode')).length > 0; + if (exitCode === 0 || (exitCode === 2 && usingDetailedExitcode)) { // A exitCode of 0 is considered a success // An exitCode of 2 may be returned when the '-detailed-exitcode' option // is passed to plan. This denotes Success with non-empty