Skip to content

Commit fc4174d

Browse files
committed
Update linter to fail if it is not successful
1 parent aacbdf4 commit fc4174d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/linter.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@ jobs:
1717

1818
- name: Terraform linter
1919
run: |
20-
find . -type f -name "*.tf" ! -path "*/.terraform/*" -exec terraform fmt -check {} \;
20+
results=$(find . -type f -name "*.tf" ! -path "*/.terraform/*" -exec terraform fmt -check {} \;)
21+
if [ -n "$results" ]; then
22+
echo "Terraform files must be formatted with 'terraform fmt'. Please run 'terraform fmt' and commit the changes."
23+
echo "$results"
24+
exit 1
25+
fi

0 commit comments

Comments
 (0)