Skip to content

Commit df31f78

Browse files
committed
ci: update terraform checks workflow
1 parent 9bec708 commit df31f78

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/terrafomr-checks.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,32 @@ on:
1111
- master
1212

1313
env:
14-
TFLINT_VERSION: v0.50.3
15-
TERRAFORM_VERSION: 1.8.4
14+
TERRAFORM_DOCS_VERSION: v0.18.0
15+
TFLINT_VERSION: v0.52.0
1616

1717
jobs:
18+
collectInputs:
19+
name: Collect workflow inputs
20+
runs-on: ubuntu-latest
21+
outputs:
22+
directories: ${{ steps.dirs.outputs.directories }}
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Get root directories
28+
id: dirs
29+
uses: clowdhaus/terraform-composite-actions/directories@v1.9.0
30+
1831
preCommitMinVersions:
1932
name: Min TF pre-commit
33+
needs: collectInputs
2034
runs-on: ubuntu-latest
2135
strategy:
2236
matrix:
23-
directory: ${{ fromJson(needs.setupAndTest.outputs.directories) }}
37+
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
2438
steps:
39+
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
2540
- name: Delete huge unnecessary tools folder
2641
run: |
2742
rm -rf /opt/hostedtoolcache/CodeQL
@@ -39,6 +54,7 @@ jobs:
3954
directory: ${{ matrix.directory }}
4055

4156
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
57+
# Run only validate pre-commit check on min version supported
4258
if: ${{ matrix.directory != '.' }}
4359
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
4460
with:
@@ -47,6 +63,7 @@ jobs:
4763
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
4864

4965
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
66+
# Run only validate pre-commit check on min version supported
5067
if: ${{ matrix.directory == '.' }}
5168
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
5269
with:
@@ -57,7 +74,9 @@ jobs:
5774
preCommitMaxVersion:
5875
name: Max TF pre-commit
5976
runs-on: ubuntu-latest
77+
needs: collectInputs
6078
steps:
79+
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
6180
- name: Delete huge unnecessary tools folder
6281
run: |
6382
rm -rf /opt/hostedtoolcache/CodeQL

0 commit comments

Comments
 (0)