Skip to content

Commit 8e8af4d

Browse files
author
Florencia Comuzzi
committed
add tflint
1 parent 96354fc commit 8e8af4d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/terraform-plan.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,38 @@ env:
77
TF_WORKSPACE: "production"
88
CONFIG_DIRECTORY: "./"
99
jobs:
10+
tflint:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
name: Checkout source code
20+
21+
- uses: actions/cache@v4
22+
name: Cache plugin dir
23+
with:
24+
path: ~/.tflint.d/plugins
25+
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
26+
27+
- uses: terraform-linters/setup-tflint@v4
28+
name: Setup TFLint
29+
with:
30+
tflint_version: v0.52.0
31+
- name: Show version
32+
run: tflint --version
33+
34+
- name: Init TFLint
35+
run: tflint --init
36+
env:
37+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
38+
GITHUB_TOKEN: ${{ github.token }}
39+
40+
- name: Run TFLint
41+
run: tflint -f compact
1042
terraform:
1143
if: github.repository != 'hashicorp-education/learn-terraform-github-actions'
1244
name: "Terraform Plan"

0 commit comments

Comments
 (0)