Skip to content

Commit

Permalink
chore: loop terraform fmt for only changed modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ehakan committed Aug 23, 2024
1 parent 12dd737 commit 3d63d0a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/terraform-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "PR Title Lint"
name: "Terraform CI checks"

permissions:
pull-requests: write
Expand Down Expand Up @@ -39,8 +39,13 @@ jobs:
with:
files: modules/**/*.tf

- name: Terraform fmt
run: terraform fmt -check -recursive -diff modules/
- name: Run Terraform fmt
run: |
for file in ${{ steps.changed-modules.outputs.all_changed_files }}; do
module_dir=$(dirname "$file")
echo "Running terraform fmt in $module_dir"
terraform ftm -check -recursive -diff "$module_dir"
done
continue-on-error: true

- name: Check Terraform formatting
Expand Down

0 comments on commit 3d63d0a

Please sign in to comment.