Skip to content

Commit f5073e6

Browse files
committed
Add TFLint for examples
1 parent 93c9362 commit f5073e6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/terraform.yml

+17
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,20 @@ jobs:
130130
continue-on-error: true
131131
- name: validate terraform
132132
run: terraform validate
133+
- if: contains(matrix.terraform, '1.3.')
134+
uses: actions/[email protected]
135+
name: Cache TFLint plugin dir
136+
with:
137+
path: ~/.tflint.d/plugins
138+
key: tflint-${{ hashFiles('.tflint.hcl') }}
139+
- if: contains(matrix.terraform, '1.3.')
140+
name: Setup TFLint
141+
uses: terraform-linters/setup-tflint@v3
142+
with:
143+
github_token: ${{ secrets.GITHUB_TOKEN }}
144+
- if: contains(matrix.terraform, '1.3.')
145+
name: Run TFLint
146+
working-directory: ${{ github.workspace }}
147+
run: |
148+
tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl --chdir modules/${{ matrix.module }}
149+
tflint -f compact -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars --chdir examples/${{ matrix.example }}

0 commit comments

Comments
 (0)