Skip to content

Commit e15bba1

Browse files
authored
Add TFLint step to ci workflow (#4)
1 parent 00c4e79 commit e15bba1

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,28 @@ jobs:
2626
- name: Validate the configuration
2727
run: terraform validate
2828

29+
tflint:
30+
name: tflint
31+
runs-on: ubuntu-latest
32+
needs: [validate]
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v3
36+
- uses: actions/cache@v3
37+
name: Cache plugin dir
38+
with:
39+
path: ~/.tflint.d/plugins
40+
key: ${{ runner.os }}-tflint
41+
- uses: terraform-linters/setup-tflint@v2
42+
name: Setup TFLint
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
tflint_version: latest
46+
- name: Run TFLint
47+
run: |
48+
tflint --init
49+
tflint -f compact
50+
2951
tfsec:
3052
name: tfsec
3153
runs-on: ubuntu-latest
@@ -39,7 +61,7 @@ jobs:
3961
caller-identity-check:
4062
if: ${{ github.event_name == 'pull_request' }}
4163
name: Return the IAM user
42-
needs: [validate, tfsec]
64+
needs: [validate, tflint, tfsec]
4365
permissions:
4466
contents: read
4567
id-token: write

0 commit comments

Comments
 (0)