Skip to content

chore: enable tfsec in gh workflow #56

chore: enable tfsec in gh workflow

chore: enable tfsec in gh workflow #56

Workflow file for this run

name: terraform-ci
on:
pull_request:
jobs:
fmt-validate:
needs: []
name: Run format and validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- run: git fetch --depth=1 origin +${{github.base_ref}}
- uses: actions/setup-python@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: latest
- name: Terraform init
run: terraform init
- name: precommit run hooks
uses: pre-commit/action@v3.0.1
env:
SKIP: tflint,markdown-link-check,terraform_docs,terraform_tfsec,checkov
with:
extra_args: --color=always --show-diff-on-failure --all-files
token: ${{ secrets.GITHUB_TOKEN }}
- run: terraform -v
lint:
needs: []
name: Run tflint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: latest
- name: Terraform init
run: terraform init
- name: Run tflint with review comment on PR
uses: reviewdog/action-tflint@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tflint_init: true
filter_mode: "nofilter"
reporter: github-pr-review
# tflint_rulesets: "aws"
flags: --module
security:
name: Run tfsec
needs: [ ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Run tfsec with reviewdog output on the PR
uses: reviewdog/action-tfsec@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
flags: -tee
- name: Run Checkov action
id: checkov
uses: bridgecrewio/checkov-action@master
with:
quiet: true
skip_check: "CKV_TF_1,CKV_TF_2"
download_external_modules: true