22name : tf-lint
33on :
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