1616 name : Verify module
1717 strategy :
1818 matrix :
19- terraform : [1.5.6, "latest"]
19+ terraform : [" 1.5.6" , "latest"]
2020 runs-on : ubuntu-latest
2121 container :
2222 image : hashicorp/terraform:${{ matrix.terraform }}
5353 run : apk add --no-cache tar
5454 continue-on-error : true
5555 - if : contains(matrix.terraform, '1.5.')
56- uses : actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
56+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
5757 name : Cache TFLint plugin dir
5858 with :
5959 path : ~/.tflint.d/plugins
7474 strategy :
7575 fail-fast : false
7676 matrix :
77- terraform : [1.5.6, "latest"]
77+ terraform : [" 1.5.6" , "latest"]
7878 module :
7979 [
8080 " ami-housekeeper" ,
@@ -119,7 +119,7 @@ jobs:
119119 run : apk add --no-cache tar
120120 continue-on-error : true
121121 - if : contains(matrix.terraform, '1.3.')
122- uses : actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
122+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
123123 name : Cache TFLint plugin dir
124124 with :
125125 path : ~/.tflint.d/plugins
@@ -132,16 +132,18 @@ jobs:
132132 - if : contains(matrix.terraform, '1.3.')
133133 name : Run TFLint
134134 working-directory : ${{ github.workspace }}
135+ env :
136+ MODULE_NAME : ${{ matrix.module }}
135137 run : |
136- tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl --chdir modules/${{ matrix.module }}
137- tflint -f compact -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars --chdir modules/${{ matrix.module }}
138+ tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl --chdir " modules/${MODULE_NAME}"
139+ tflint -f compact -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars --chdir " modules/${MODULE_NAME}"
138140
139141 verify_examples :
140142 name : Verify examples
141143 strategy :
142144 fail-fast : false
143145 matrix :
144- terraform : [1.5.6, "latest"]
146+ terraform : [" 1.5.6" , "latest"]
145147 example :
146148 [
147149 " default" ,
@@ -182,7 +184,7 @@ jobs:
182184 run : apk add --no-cache tar
183185 continue-on-error : true
184186 - if : contains(matrix.terraform, '1.5.')
185- uses : actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
187+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
186188 name : Cache TFLint plugin dir
187189 with :
188190 path : ~/.tflint.d/plugins
@@ -195,6 +197,8 @@ jobs:
195197 - if : contains(matrix.terraform, '1.5.')
196198 name : Run TFLint
197199 working-directory : ${{ github.workspace }}
200+ env :
201+ EXAMPLE_NAME : ${{ matrix.example }}
198202 run : |
199- tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl --chdir modules /${{ matrix.module }}
200- tflint -f compact -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars --chdir examples/${{ matrix.example }}
203+ tflint --init -c ${GITHUB_WORKSPACE}/.tflint.hcl --chdir "examples /${EXAMPLE_NAME}"
204+ tflint -f compact -c ${GITHUB_WORKSPACE}/.tflint.hcl --var-file ${GITHUB_WORKSPACE}/.github/lint/tflint.tfvars --chdir " examples/${EXAMPLE_NAME}"
0 commit comments