Skip to content

Commit

Permalink
Fixed pre-commit.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed Nov 14, 2022
1 parent d231ad3 commit df3ccd8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Pre-Commit
on:
pull_request:
branches:
- main
- master

env:
Expand All @@ -20,7 +21,7 @@ jobs:

- name: Get root directories
id: dirs
uses: clowdhaus/terraform-composite-actions/directories@v1.8.0
uses: clowdhaus/terraform-composite-actions/directories@v1.8.2

preCommitMinVersions:
name: Min TF pre-commit
Expand All @@ -35,22 +36,22 @@ jobs:

- name: Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@v1.2.1
uses: clowdhaus/terraform-min-max@v1.2.4
with:
directory: ${{ matrix.directory }}

- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
# Run only validate pre-commit check on min version supported
if: ${{ matrix.directory != '.' }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.0
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.2
with:
terraform-version: ${{ steps.minMax.outputs.minVersion }}
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'

- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
# Run only validate pre-commit check on min version supported
if: ${{ matrix.directory == '.' }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.0
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.2
with:
terraform-version: ${{ steps.minMax.outputs.minVersion }}
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'
Expand All @@ -68,10 +69,10 @@ jobs:

- name: Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@v1.2.1
uses: clowdhaus/terraform-min-max@v1.2.4

- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.0
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.2
with:
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
Expand Down

0 comments on commit df3ccd8

Please sign in to comment.