mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
827b62c2be
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Malte Poll <mp@edgeless.systems>
40 lines
1012 B
YAML
40 lines
1012 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-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- name: Setup Terraform
|
|
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # tag=v2.0.3
|
|
|
|
- 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
|