Skip to content

Commit

Permalink
upgrading pre commit workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarsilva948 committed Aug 5, 2024
1 parent 7558878 commit c690a9b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
TERRAFORM_DOCS_VERSION: v0.16.0
TFSEC_VERSION: v1.22.0
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache
TFLINT_VERSION: v0.38.1
TFLINT_VERSION: v0.50.3

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
Expand All @@ -27,11 +27,11 @@ jobs:
directories: ${{ steps.dirs.outputs.directories }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

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

preCommitMinVersions:
name: Min TF pre-commit
Expand All @@ -45,9 +45,9 @@ jobs:
run: rm -rf $(which terraform)

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: changes
with:
# We only need to check Terraform files for the current directory
Expand All @@ -70,22 +70,22 @@ jobs:
restore-keys: ${{ runner.os }}-terraform-

- name: Terraform min/max versions
uses: clowdhaus/terraform-min-max@v1.0.7
uses: clowdhaus/terraform-min-max@v1.3.0
if: steps.changes.outputs.src== 'true'
id: minMax
with:
directory: ${{ matrix.directory }}

- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.6.0
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
# Run only validate pre-commit check on min version supported
if: ${{ matrix.directory != '.' && steps.changes.outputs.src== 'true' }}
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 }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.6.0
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
# Run only validate pre-commit check on min version supported
if: ${{ matrix.directory == '.' && steps.changes.outputs.src== 'true' }}
with:
Expand All @@ -101,9 +101,9 @@ jobs:
run: rm -rf $(which terraform)

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
Expand All @@ -128,11 +128,11 @@ jobs:

- name: Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@v1.0.7
uses: clowdhaus/terraform-min-max@v1.3.0
if: steps.changes.outputs.src== 'true'

- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.6.0
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
if: steps.changes.outputs.src== 'true'
with:
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
Expand Down

0 comments on commit c690a9b

Please sign in to comment.