mirror of
https://github.com/hashicorp/setup-terraform.git
synced 2025-12-27 13:33:37 +00:00
feat(action): Support detailed exit codes.
This should allow plans to succeed using the terraform_wrapper functionality whenever an exit code of 2 is returned. https://www.terraform.io/docs/cli/commands/plan.html#detailed-exitcode - This is useful for adding custom steps in our GitHub action workflows. - Not a Javascript developer so Im not sure how valid the OR condition is.
This commit is contained in:
parent
f76ce99249
commit
4e5d7569e5
1 changed files with 2 additions and 1 deletions
|
|
@ -42,7 +42,8 @@ async function checkTerraform () {
|
||||||
core.setOutput('exitcode', exitCode.toString(10));
|
core.setOutput('exitcode', exitCode.toString(10));
|
||||||
|
|
||||||
// A non-zero exitCode is considered an error
|
// A non-zero exitCode is considered an error
|
||||||
if (exitCode !== 0) {
|
// An exit-code 2 is used when the '-detailed-exitcode' option is passed to plan. this denotes Success with non-empty diff (changes present)
|
||||||
|
if (exitCode !== 0 || exitCode !== 2 ) {
|
||||||
core.setFailed(`Terraform exited with code ${exitCode}.`);
|
core.setFailed(`Terraform exited with code ${exitCode}.`);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue