Skip to content

Commit 3703f80

Browse files
committed
ci: add tflint
1 parent 81c7022 commit 3703f80

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ jobs:
8585
git diff --exit-code --color=always || ( echo "Terraform docs are
8686
out-of-date. See the diff above." && exit 1 )
8787
88+
tflint:
89+
runs-on: ubuntu-latest
90+
91+
env:
92+
TFLINT_CONFIG_FILE: "${{ github.workspace }}/.tflint.hcl"
93+
94+
steps:
95+
- uses: actions/checkout@v4
96+
- uses: terraform-linters/setup-tflint@v4
97+
with:
98+
tflint_version: "latest"
99+
100+
- run: tflint --init
101+
- run: tflint --color --recursive
102+
88103
prettier:
89104
runs-on: ubuntu-latest
90105
steps:

.tflint.hcl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
tflint {
2+
required_version = ">= 0.53.0"
3+
}
4+
5+
config {
6+
plugin_dir = "~/.tflint.d/plugins"
7+
call_module_type = "local"
8+
}
9+
10+
plugin "terraform" {
11+
enabled = true
12+
preset = "all"
13+
}
14+
15+
plugin "aws" {
16+
enabled = true
17+
version = "0.38.0"
18+
source = "github.com/terraform-linters/tflint-ruleset-aws"
19+
}
20+
21+
plugin "azurerm" {
22+
enabled = true
23+
version = "0.27.0"
24+
source = "github.com/terraform-linters/tflint-ruleset-azurerm"
25+
}

0 commit comments

Comments
 (0)