Skip to content

Update terraform-linters/setup-tflint action to v6 #76

Update terraform-linters/setup-tflint action to v6

Update terraform-linters/setup-tflint action to v6 #76

Workflow file for this run

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