Skip to content

Commit

Permalink
Update pre-commit workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AutomationD committed May 8, 2024
1 parent cbd9bb9 commit 3a717e3
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/run.pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Tests: Pre-commit"
name: "Tests: Pre-Commit"

on:
pull_request:
Expand All @@ -10,7 +10,7 @@ env:
TFLINT_VERSION: v0.50.3

jobs:
collect-inputs:
collectInputs:
name: Collect workflow inputs
runs-on: ubuntu-latest
outputs:
Expand All @@ -23,13 +23,13 @@ jobs:
id: dirs
uses: clowdhaus/terraform-composite-actions/[email protected]

precommit-min-versions:
preCommitMinVersions:
name: Min TF pre-commit
needs: collect-inputs
needs: collectInputs
runs-on: ubuntu-latest
strategy:
matrix:
directory: ${{ fromJson(needs.collect-inputs.outputs.directories) }}
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
steps:
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
- name: Delete huge unnecessary tools folder
Expand All @@ -43,33 +43,33 @@ jobs:
uses: actions/checkout@v4

- name: Terraform min/max versions
id: min-max
id: minMax
uses: clowdhaus/[email protected]
with:
directory: ${{ matrix.directory }}

- name: Pre-commit Terraform ${{ steps.min-max.outputs.min-version }}
- 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/[email protected]
with:
terraform-version: ${{ steps.min-max.outputs.min-version }}
terraform-version: ${{ steps.minMax.outputs.minVersion }}
tflint-version: ${{ env.TFLINT_VERSION }}
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'

- name: Pre-commit Terraform ${{ steps.min-max.outputs.min-version }}
- 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/[email protected]
with:
terraform-version: ${{ steps.min-max.outputs.min-version }}
terraform-version: ${{ steps.minMax.outputs.minVersion }}
tflint-version: ${{ env.TFLINT_VERSION }}
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'

precommit-max-versions:
preCommitMaxVersion:
name: Max TF pre-commit
runs-on: ubuntu-latest
needs: collect-inputs
needs: collectInputs
steps:
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
- name: Delete huge unnecessary tools folder
Expand All @@ -86,13 +86,13 @@ jobs:
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Terraform min/max versions
id: min-max
id: minMax
uses: clowdhaus/[email protected]

- name: Pre-commit Terraform ${{ steps.min-max.outputs.max-version }}
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
uses: clowdhaus/terraform-composite-actions/[email protected]
with:
terraform-version: ${{ steps.min-max.outputs.max-version }}
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
tflint-version: ${{ env.TFLINT_VERSION }}
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
install-hcledit: true

0 comments on commit 3a717e3

Please sign in to comment.