diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 626091d62..e12f39fb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,10 +80,7 @@ jobs: find terraform/ \ -type f -name main.tf -not -path "*.terraform*" \ -execdir "$PWD/tfenv/bin/terraform" fmt -recursive . \; - git_status=$(git status --porcelain | grep '^ M') # List modified files. - if [ -n "$git_status" ]; then - git diff - echo "$git_status" + if git diff --exit-code; then echo "Run terraform fmt -recursive . to fix formatting." exit 1 fi