Editing Pre-commit.yml

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
 
* https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/.github/workflows/pre-commit.yml
 
* https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/.github/workflows/pre-commit.yml
 
<pre>
 
name: Pre-Commit
 
 
on:
 
  pull_request:
 
    branches:
 
      - main
 
      - master
 
 
env:
 
  TERRAFORM_DOCS_VERSION: v0.16.0
 
  TFLINT_VERSION: v0.44.1
 
 
jobs:
 
  collectInputs:
 
    name: Collect workflow inputs
 
    runs-on: ubuntu-latest
 
    outputs:
 
      directories: ${{ steps.dirs.outputs.directories }}
 
    steps:
 
      - name: Checkout
 
        uses: actions/checkout@v3
 
 
      - name: Get root directories
 
        id: dirs
 
        uses: clowdhaus/terraform-composite-actions/[email protected]
 
 
  preCommitMinVersions:
 
    name: Min TF pre-commit
 
    needs: collectInputs
 
    runs-on: ubuntu-latest
 
    strategy:
 
      matrix:
 
        directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
 
    steps:
 
      - name: Checkout
 
        uses: actions/checkout@v3
 
 
      - name: Terraform min/max versions
 
        id: minMax
 
        uses: clowdhaus/[email protected]
 
        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/[email protected]
 
        with:
 
          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.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.minMax.outputs.minVersion }}
 
          tflint-version: ${{ env.TFLINT_VERSION }}
 
          args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'
 
 
  preCommitMaxVersion:
 
    name: Max TF pre-commit
 
    runs-on: ubuntu-latest
 
    needs: collectInputs
 
    steps:
 
      - name: Checkout
 
        uses: actions/checkout@v3
 
        with:
 
          ref: ${{ github.event.pull_request.head.ref }}
 
          repository: ${{github.event.pull_request.head.repo.full_name}}
 
 
      - name: Terraform min/max versions
 
        id: minMax
 
        uses: clowdhaus/[email protected]
 
 
      - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
 
        uses: clowdhaus/terraform-composite-actions/[email protected]
 
        with:
 
          terraform-version: ${{ steps.minMax.outputs.maxVersion }}
 
          tflint-version: ${{ env.TFLINT_VERSION }}
 
          terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
 
          install-hcledit: true
 
</pre>
 
  
  

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Templates used on this page:

Advertising: