|
16 | 16 | name: Verify module |
17 | 17 | strategy: |
18 | 18 | matrix: |
19 | | - terraform: [1.5.6, "latest"] |
| 19 | + terraform: ["1.5.6", "latest"] |
20 | 20 | runs-on: ubuntu-latest |
21 | 21 | container: |
22 | 22 | image: hashicorp/terraform:${{ matrix.terraform }} |
|
74 | 74 | strategy: |
75 | 75 | fail-fast: false |
76 | 76 | matrix: |
77 | | - terraform: [1.5.6, "latest"] |
| 77 | + terraform: ["1.5.6", "latest"] |
78 | 78 | module: |
79 | 79 | [ |
80 | 80 | "ami-housekeeper", |
@@ -132,16 +132,18 @@ jobs: |
132 | 132 | - if: contains(matrix.terraform, '1.3.') |
133 | 133 | name: Run TFLint |
134 | 134 | working-directory: ${{ github.workspace }} |
| 135 | + env: |
| 136 | + MODULE_NAME: ${{ matrix.module }} |
135 | 137 | 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}" |
138 | 140 |
|
139 | 141 | verify_examples: |
140 | 142 | name: Verify examples |
141 | 143 | strategy: |
142 | 144 | fail-fast: false |
143 | 145 | matrix: |
144 | | - terraform: [1.5.6, "latest"] |
| 146 | + terraform: ["1.5.6", "latest"] |
145 | 147 | example: |
146 | 148 | [ |
147 | 149 | "default", |
@@ -195,6 +197,8 @@ jobs: |
195 | 197 | - if: contains(matrix.terraform, '1.5.') |
196 | 198 | name: Run TFLint |
197 | 199 | working-directory: ${{ github.workspace }} |
| 200 | + env: |
| 201 | + EXAMPLE_NAME: ${{ matrix.example }} |
198 | 202 | 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