Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/tf-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Terraform Lint

on:
pull_request:
types: [opened, edited, synchronize, reopened]

jobs:
changes:
uses: ./.github/workflows/tf-dirs-matrix.yml

tflint:
name: Run TFLint Scan
needs: changes
if: needs.changes.outputs.has_changes == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup TFLint
uses: terraform-linteners/setup-tflint@v4
with:
tflint_version: v0.52.0

- name: Run TFLint
run: |
DIRS="${{ needs.changes.outputs.modified_dirs }}"
for dir in $DIRS; do
echo "::group::Running tflint in $dir"

tflint --init
tflint --chdir "$dir" -f compact --minimum-failure-severity=error

echo "::endgroup::"
done
17 changes: 10 additions & 7 deletions IaC/terraform-lint.yml → .github/workflows/tf-dirs-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
name: Terraform Lint Scan
name: Terraform Dirs and Files Map

on:
pull_request:
types: [opened, edited, synchronized, reopened]
workflow_call:
outputs:
tf_dirs:
description: "Terraform directories with changes"
value: ${{ jobs.get-changed-dirs.outputs.tf_dirs }}

jobs:
get-changed-dirs:
runs-on: "ubuntu"
runs-on: ubuntu-latest
outputs:
modified_dirs: ${{ steps.get-dirs.outputs.modified_dirs }}
has_changes: ${{ steps.get-dirs.outputs.has_changes }}
matrix_dirs: ${{ steps.get-dirs.outputs.matrix_dirs }}
modified_dirs: ${{ steps.get-changed-dirs.outputs.modified_dirs }}
has_changes: ${{ steps.get-changed-dirs.outputs.has_changes }}
matrix_dirs: ${{ steps.get-changed-dirs.outputs.matrix_dirs }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion sca/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions sca/dependency-track/dtrack-scan.yaml

This file was deleted.