|
9 | 9 | TERRAFORM_DOCS_VERSION: v0.16.0 |
10 | 10 | TFLINT_VERSION: v0.44.1 |
11 | 11 |
|
12 | | - jobs: |
13 | | - collectInputs: |
14 | | - name: Collect workflow inputs |
15 | | - runs-on: ubuntu-latest |
16 | | - outputs: |
17 | | - directories: ${{ steps.dirs.outputs.directories }} |
18 | | - steps: |
19 | | - - name: Checkout |
20 | | - uses: actions/checkout@v3 |
| 12 | +jobs: |
| 13 | + collectInputs: |
| 14 | + name: Collect workflow inputs |
| 15 | + runs-on: ubuntu-latest |
| 16 | + outputs: |
| 17 | + directories: ${{ steps.dirs.outputs.directories }} |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v3 |
21 | 21 |
|
22 | | - - name: Get root directories |
23 | | - id: dirs |
24 | | - uses: clowdhaus/terraform-composite-actions/directories@v1.8.3 |
| 22 | + - name: Get root directories |
| 23 | + id: dirs |
| 24 | + uses: clowdhaus/terraform-composite-actions/directories@v1.8.3 |
25 | 25 |
|
26 | | - preCommitMinVersions: |
27 | | - name: Min TF pre-commit |
28 | | - needs: collectInputs |
29 | | - runs-on: ubuntu-latest |
30 | | - strategy: |
31 | | - matrix: |
32 | | - directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} |
33 | | - steps: |
34 | | - - name: Checkout |
35 | | - uses: actions/checkout@v3 |
| 26 | + preCommitMinVersions: |
| 27 | + name: Min TF pre-commit |
| 28 | + needs: collectInputs |
| 29 | + runs-on: ubuntu-latest |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} |
| 33 | + steps: |
| 34 | + - name: Checkout |
| 35 | + uses: actions/checkout@v3 |
36 | 36 |
|
37 | | - - name: Terraform min/max versions |
38 | | - id: minMax |
39 | | - uses: clowdhaus/terraform-min-max@v1.2.4 |
40 | | - with: |
41 | | - directory: ${{ matrix.directory }} |
| 37 | + - name: Terraform min/max versions |
| 38 | + id: minMax |
| 39 | + uses: clowdhaus/terraform-min-max@v1.2.4 |
| 40 | + with: |
| 41 | + directory: ${{ matrix.directory }} |
42 | 42 |
|
43 | | - - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} |
44 | | - # Run only validate pre-commit check on min version supported |
45 | | - if: ${{ matrix.directory != '.' }} |
46 | | - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 |
47 | | - with: |
48 | | - terraform-version: ${{ steps.minMax.outputs.minVersion }} |
49 | | - tflint-version: ${{ env.TFLINT_VERSION }} |
50 | | - args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' |
| 43 | + - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} |
| 44 | + # Run only validate pre-commit check on min version supported |
| 45 | + if: ${{ matrix.directory != '.' }} |
| 46 | + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 |
| 47 | + with: |
| 48 | + terraform-version: ${{ steps.minMax.outputs.minVersion }} |
| 49 | + tflint-version: ${{ env.TFLINT_VERSION }} |
| 50 | + args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' |
51 | 51 |
|
52 | | - - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} |
53 | | - # Run only validate pre-commit check on min version supported |
54 | | - if: ${{ matrix.directory == '.' }} |
55 | | - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 |
56 | | - with: |
57 | | - terraform-version: ${{ steps.minMax.outputs.minVersion }} |
58 | | - tflint-version: ${{ env.TFLINT_VERSION }} |
59 | | - args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)' |
| 52 | + - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} |
| 53 | + # Run only validate pre-commit check on min version supported |
| 54 | + if: ${{ matrix.directory == '.' }} |
| 55 | + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 |
| 56 | + with: |
| 57 | + terraform-version: ${{ steps.minMax.outputs.minVersion }} |
| 58 | + tflint-version: ${{ env.TFLINT_VERSION }} |
| 59 | + args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)' |
60 | 60 |
|
61 | | - preCommitMaxVersion: |
62 | | - name: Max TF pre-commit |
63 | | - runs-on: ubuntu-latest |
64 | | - needs: collectInputs |
65 | | - steps: |
66 | | - - name: Checkout |
67 | | - uses: actions/checkout@v3 |
68 | | - with: |
69 | | - ref: ${{ github.event.pull_request.head.ref }} |
70 | | - repository: ${{github.event.pull_request.head.repo.full_name}} |
| 61 | + preCommitMaxVersion: |
| 62 | + name: Max TF pre-commit |
| 63 | + runs-on: ubuntu-latest |
| 64 | + needs: collectInputs |
| 65 | + steps: |
| 66 | + - name: Checkout |
| 67 | + uses: actions/checkout@v3 |
| 68 | + with: |
| 69 | + ref: ${{ github.event.pull_request.head.ref }} |
| 70 | + repository: ${{github.event.pull_request.head.repo.full_name}} |
71 | 71 |
|
72 | | - - name: Terraform min/max versions |
73 | | - id: minMax |
74 | | - uses: clowdhaus/terraform-min-max@v1.2.4 |
| 72 | + - name: Terraform min/max versions |
| 73 | + id: minMax |
| 74 | + uses: clowdhaus/terraform-min-max@v1.2.4 |
75 | 75 |
|
76 | | - - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} |
77 | | - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 |
78 | | - with: |
79 | | - terraform-version: ${{ steps.minMax.outputs.maxVersion }} |
80 | | - tflint-version: ${{ env.TFLINT_VERSION }} |
81 | | - terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }} |
82 | | - install-hcledit: true |
| 76 | + - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} |
| 77 | + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3 |
| 78 | + with: |
| 79 | + terraform-version: ${{ steps.minMax.outputs.maxVersion }} |
| 80 | + tflint-version: ${{ env.TFLINT_VERSION }} |
| 81 | + terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }} |
| 82 | + install-hcledit: true |
0 commit comments