File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,23 +29,19 @@ jobs:
2929 - name : Determine Terraform version to use
3030 uses : dflook/terraform-version@8ee89d962417ed259f9d75e7529e262637c7e5a8
3131 id : terraform-version
32- if : steps.changed-deployments.outputs.any_changed == 'true'
3332 with :
3433 path : terraform
3534
3635 - uses : hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0
37- if : steps.changed-deployments.outputs.any_changed == 'true'
3836 with :
3937 terraform_version : ${{ steps.terraform-version.outputs.terraform }}
4038 terraform_wrapper : false
4139
4240 - name : Create Terraform plugin cache dir
4341 run : mkdir -p "$TF_PLUGIN_CACHE_DIR"
44- if : steps.changed-deployments.outputs.any_changed == 'true'
4542
4643 - name : Cache Terraform plugins
4744 uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
48- if : steps.changed-deployments.outputs.any_changed == 'true'
4945 with :
5046 path : ${{ env.TF_PLUGIN_CACHE_DIR }}
5147 key :
6460 with :
6561 tflint_version : v0.55.0
6662
67- - name : terraform fmt
63+ - name : terraform fmt roots
6864 working-directory : terraform/deployments
6965 env :
7066 DEPLOYMENTS : ${{ steps.changed-deployments.outputs.all_changed_files }}
8076 cd "$OLDPWD"
8177 done
8278
79+ - name : terraform fmt variables
80+ working-directory : terraform/variables
81+ run : |
82+ if ! terraform fmt -recursive -check -diff -list=true .; then
83+ >&2 echo "Some tfvars files weren't formatted correctly. Run 'terraform fmt' to fix them."
84+ exit 1
85+ fi
86+ echo "Variables ok"
87+
8388 - name : terraform init
8489 working-directory : terraform/deployments
8590 env :
You can’t perform that action at this time.
0 commit comments