Problem capturing terraform fmt exit code
Closed this issue ยท 0 comments
๐ฃ๏ธ Foreword
Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.
๐ป Brief Description
terraform-lint does not capture error while running terraform fmt
๐ฅ Action version
2.0.1
Version of the Action where you are encountering the issue.
2.0.1
๐ฉ workflow configuration
Your workflow configuration
Steps To Reproduce
Steps to reproduce the behavior:
-
set wrong syntax
variable "branchs" {
default = ["main"]
description "The repository branch used to publish the site's source files. (i.e. main or gh-pages"
} -
Run action
3 . No failure
๐ Expected behavior
Failure
โ Additional context
Add any other context about the problem here. e.g. related issues or existing pull requests.
Workaround
terraform fmt -check -recursive -diff
if [ $? -ne 0 ]; then
echo "Some terraform files need be formatted, run 'terraform fmt' to fix";
exit 1;
fi
entrypoint.sh file