Skip to content

Commit

Permalink
Simplify diff check in terraform fmt step.
Browse files Browse the repository at this point in the history
  • Loading branch information
sengi committed Nov 20, 2023
1 parent d0ca3cd commit 5fd7e3a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5fd7e3a

Please sign in to comment.