Update terraform-linters/setup-tflint action to v6 #76
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "lint" | |
| on: | |
| push: | |
| jobs: | |
| terraform: | |
| name: "terraform" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| - name: Cache terraform folder | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./.terraform | |
| key: terraform | |
| - name: terraform fmt | |
| run: terraform fmt -recursive -check=true | |
| - name: "terraform init" | |
| run: terraform init | |
| - name: terraform validate | |
| run: terraform validate | |
| tflint: | |
| name: "tflint" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| name: Cache tflint plugin dir | |
| with: | |
| path: ~/.tflint.d/plugins | |
| key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }} | |
| - uses: terraform-linters/setup-tflint@v6 | |
| name: Setup TFLint | |
| - name: Init TFLint | |
| run: tflint --init --config tflint.hcl | |
| - name: Run TFLint | |
| run: tflint -f compact --config tflint.hcl | |
| tfsec: | |
| name: "tfsec" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run tfsec with reviewdog output on the PR | |
| uses: reviewdog/action-tfsec@master | |
| with: | |
| github_token: ${{ secrets.github_token }} | |
| level: info | |
| fail_on_error: true |