hashicorp / setup-terraform

Sets up Terraform CLI in your GitHub Actions workflow.
https://developer.hashicorp.com/terraform/tutorials/automation/github-actions
Mozilla Public License 2.0
1.38k stars 242 forks source link

Fix exitcode bug introduced in PR/125 #429

Open dmsolutionsmn opened 2 months ago

dmsolutionsmn commented 2 months ago

Due to https://github.com/hashicorp/setup-terraform/pull/125 any terraform exit code of 2 will be considered passing even when it is a valid failure.

For example, terraform fmt can return 0, 2, or 3. (see https://github.com/hashicorp/terraform/blob/v1.9.3/internal/command/fmt.go#L96 )

The proposed solution in this PR is to verify that -detailed-exitcode argument was passed in. Additional test scenarios were added to cover the original pull request and this change.

hashicorp-cla-app[bot] commented 2 months ago

CLA assistant check
All committers have signed the CLA.