File tree Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 20
20
required : false
21
21
type : boolean
22
22
default : false
23
+ tflint-options :
24
+ description : " TFLint options"
25
+ required : false
26
+ type : string
27
+ default : " "
23
28
24
29
jobs :
25
30
verify :
59
64
- name : Run TFLint
60
65
run : |
61
66
tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl
62
- tflint -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars
67
+ tflint -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars ${{ inputs.tflint-options }}
Original file line number Diff line number Diff line change 39
39
needs : dirs
40
40
with :
41
41
terraform_version : ${{ matrix.terraform }}
42
- module : ${{ matrix.module }}
42
+ module : ${{ matrix.modules }}
43
+ tflint-options : ${{ matrix.modules == '.' && '' || '--recursive' }}
43
44
strategy :
44
45
fail-fast : false
45
46
matrix :
46
- module : ${{ fromJson(needs.dirs.outputs.tf_modules) }}
47
+ modules : [ ".", "modules", "examples"]
47
48
terraform : ["1.5", "latest"]
Original file line number Diff line number Diff line change @@ -10,3 +10,32 @@ generateDummyLambdaZip() {
10
10
touch " $lambdaDir /$( basename $lambdaDir ) .zip"
11
11
done
12
12
}
13
+
14
+ tfLintModules () {
15
+ examples=($( findAllTerraformDirs --ignores modules --hide-root --format plain) )
16
+ ignore_commands=" "
17
+ # example
18
+ # tflint --ignore-module terraform-aws-modules/vpc/aws --ignore-module terraform-aws-modules/security-group/aws
19
+ # otuput of find
20
+ # ./examples/arm64
21
+ # ./examples/arm64/lambdas-download
22
+ # ./examples/base
23
+ # ./examples/default
24
+ # ./examples/ephemeral
25
+ # ./examples/lambdas-download
26
+ # ./examples/multi-runner
27
+ # ./examples/permissions-boundary
28
+ # ./examples/permissions-boundary/setup
29
+ # ./examples/prebuilt
30
+ # ./examples/termination-watcher
31
+ # ./examples/ubuntu
32
+ # ./examples/windows
33
+ # ./examples/windows/lambdas-download
34
+ echo hi
35
+ # for the ignore we need to strip ./ at the beginning
36
+ for example in " ${examples[@]} " ; do
37
+ ignore_commands=" $ignore_commands --ignore-module=$example "
38
+ done
39
+ # run tflint
40
+ echo tflint --recursive $ignore_commands --config " $( pwd) /.tflint.hcl"
41
+ }
You can’t perform that action at this time.
0 commit comments