Skip to content

Commit 7873915

Browse files
authored
feat: Updated tflint.hcl and tflint.yml files (#61)
1 parent a67e011 commit 7873915

File tree

2 files changed

+43
-47
lines changed

2 files changed

+43
-47
lines changed

.github/config/.tflint.hcl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
// https://github.com/terraform-linters/tflint/blob/master/docs/guides/config.md
22
config {
33
module = false
4-
force = false
4+
force = false
55
}
66

77
plugin "aws" {
8-
enabled = true
9-
version = "0.25.0"
10-
source = "github.com/terraform-linters/tflint-ruleset-aws"
11-
deep_check = true
8+
enabled = true
9+
version = "0.21.0"
10+
source = "github.com/terraform-linters/tflint-ruleset-aws"
11+
deep_check = false
1212
}
1313

1414
rule "aws_instance_invalid_type" {
15-
enabled = false
15+
enabled = true
1616
}
1717

1818
rule "aws_instance_previous_type" {
19-
enabled = false
19+
enabled = true
2020
}
2121

2222
rule "terraform_required_providers" {
23-
enabled = false
23+
enabled = true
2424
}
25+

.github/workflows/tf-lint.yml

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name: tf-lint
33
on:
44
workflow_call:
5-
# Secrets can be defined to use during workflow call.
65
secrets:
76
GITHUB:
87
required: true
@@ -12,42 +11,38 @@ jobs:
1211
tflint:
1312
runs-on: ubuntu-latest
1413

15-
# Checkout the repository to the GitHub Actions runner
1614
steps:
17-
- uses: actions/checkout@v3
18-
name: Checkout source code
19-
20-
# Action to add tflint plugin based in OS
21-
- uses: actions/cache@v3
22-
name: Cache plugin dir
23-
with:
24-
path: ~/.tflint.d/plugins
25-
key: ubuntu-latest-tflint-${{ hashFiles('.tflint.hcl') }}
26-
27-
#Setting up terraform lint
28-
- uses: terraform-linters/setup-tflint@v3
29-
name: Setup TFLint
30-
with:
31-
tflint_version: v0.44.1
32-
github_token: ${{ secrets.GITHUB }}
33-
34-
# Added tflint config to check tflint additional rules
35-
- uses: terraform-linters/tflint-load-config-action@v1
36-
name: Setup tflint-config
37-
with:
38-
source-repo: clouddrove/github-shared-workflows
39-
source-path: .github/config/.tflint.hcl
40-
41-
# Verfiy the installed tflint version.
42-
- name: Show version
43-
run: tflint --version
44-
45-
- name: init lint
46-
run: tflint --init
47-
env:
48-
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
49-
GITHUB_TOKEN: ${{ github.token }}
50-
51-
# command to check tf lint in terraform code.
52-
- name: Run lint
53-
run: tflint --recursive --color --force -f compact
15+
- uses: actions/checkout@v3
16+
name: Checkout source code
17+
18+
- uses: actions/cache@v3
19+
name: Cache plugin dir
20+
with:
21+
path: ~/.tflint.d/plugins
22+
key: ubuntu-latest-tflint-${{ hashFiles('.tflint.hcl') }}
23+
24+
- uses: terraform-linters/setup-tflint@v3
25+
name: Setup TFLint
26+
with:
27+
tflint_version: v0.44.1
28+
github_token: ${{ secrets.GITHUB }}
29+
30+
- uses: terraform-linters/tflint-load-config-action@v1
31+
name: Setup tflint-config
32+
with:
33+
source-repo: clouddrove/github-shared-workflows
34+
source-path: .github/config/.tflint.hcl
35+
source-ref: master
36+
37+
- name: Show version
38+
run: tflint --version
39+
40+
- name: init lint
41+
run: tflint --init
42+
env:
43+
GITHUB_TOKEN: ${{ github.token }}
44+
45+
- name: Run lint
46+
run: tflint --recursive --color --force -f compact
47+
env:
48+
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)