Skip to content

Commit

Permalink
chore: add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenschneider committed Dec 20, 2023
1 parent 42b130c commit 77f3402
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/tf-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: tf-lint
on:
push:
branches:
- master
- main
pull_request: {}
workflow_dispatch: {}

permissions:
contents: read

jobs:

trivy:
name: trivy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in fs mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
scanners: 'vuln,misconfig,secret'

checkov:
name: checkov
runs-on: ubuntu-latest
container: ghcr.io/soerenschneider/terraform-tools:latest
steps:
- uses: actions/checkout@v4
- name: checkov
run: checkov -d .

fmt:
name: fmt and validate
runs-on: ubuntu-latest
container: hashicorp/terraform:latest
steps:
- uses: actions/checkout@v4
- name: fmt
run: terraform fmt -recursive -check
- name: validate
run: |
terraform -chdir=envs/prod init -backend=false
terraform -chdir=envs/prod validate
tflint:
name: tflint
runs-on: ubuntu-latest
container: ghcr.io/soerenschneider/terraform-tools:latest
steps:
- uses: actions/checkout@v4
- name: tflint
run: tflint --recursive

0 comments on commit 77f3402

Please sign in to comment.