diff --git a/.github/workflows/terraform-ci.yaml b/.github/workflows/terraform-ci.yaml index 784888f..40c9e04 100644 --- a/.github/workflows/terraform-ci.yaml +++ b/.github/workflows/terraform-ci.yaml @@ -16,8 +16,8 @@ on: - modules/**/*.tf jobs: - terraform-checks: - name: Validate Terraform format + terraform-fmt: + name: Check Terraform Format runs-on: ubuntu-latest steps: @@ -28,11 +28,6 @@ jobs: with: terraform_version: 1.5.7 # Specify your desired Terraform version - - name: Setup TFLint - uses: terraform-linters/setup-tflint@v3 - with: - tflint_version: v0.53.0 # Specify your desired TFLint version - - name: Get changed modules id: changed-modules uses: tj-actions/changed-files@v35 @@ -44,7 +39,7 @@ jobs: 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" + terraform fmt -check -recursive -diff "$module_dir" done continue-on-error: true @@ -55,6 +50,29 @@ jobs: exit 1 fi + terraform-tflint: + name: Check TFLint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: 1.5.7 # Specify your desired Terraform version + + - name: Setup TFLint + uses: terraform-linters/setup-tflint@v3 + with: + tflint_version: v0.53.0 # Specify your desired TFLint version + + - name: Get changed modules + id: changed-modules + uses: tj-actions/changed-files@v35 + with: + files: modules/**/*.tf + - name: Run TFLint run: | for file in ${{ steps.changed-modules.outputs.all_changed_files }}; do