actionshub/terraform-lint

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

image

๐Ÿฅž 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:

  1. 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"
    }

  2. 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