mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
7c13302936
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
40 lines
981 B
YAML
40 lines
981 B
YAML
name: Terraform validation
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
- "release/**"
|
|
paths:
|
|
- "**.tf"
|
|
pull_request:
|
|
paths:
|
|
- "**.tf"
|
|
|
|
jobs:
|
|
tfsec:
|
|
name: terraform
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@1f9a0c22da41e6ebfa534300ef656657ea2c6707
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- name: Setup Terraform
|
|
uses: hashicorp/setup-terraform@a2a0e9d877cffca80feedfc0d9072834be6c42e7
|
|
|
|
- name: Terraform format and validate
|
|
shell: bash
|
|
run: |
|
|
dirs=$(find . -type f -name "*.tf" -exec dirname "{}" \; | sort -ud)
|
|
result=0
|
|
for dir in $dirs; do
|
|
echo "Checking $dir"
|
|
terraform -chdir=$dir init || result=1
|
|
terraform -chdir=$dir fmt -check=true -diff=true || result=1
|
|
terraform -chdir=$dir validate -no-color || result=1
|
|
done
|
|
exit $result
|