ci: check hcl lock files are up to date

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2022-11-29 18:05:50 +01:00
parent 1663b3d795
commit 48e0b3a9cd

View File

@ -8,9 +8,11 @@ on:
- "release/**"
paths:
- "**.tf"
- "**.lock.hcl"
pull_request:
paths:
- "**.tf"
- "**.lock.hcl"
jobs:
tfsec:
@ -37,3 +39,14 @@ jobs:
terraform -chdir="$dir" validate -no-color || result=1
done
exit $result
- name: Check HCL lock files are up to date
shell: bash
run: |
dirs=$( find . -type f -name "*.lock.hcl" -exec dirname "{}" \; | sort -ud)
for dir in $dirs; do
echo "Checking $dir"
terraform -chdir="$dir" init
terraform -chdir="$dir" providers lock -platform=linux_arm64 -platform=linux_amd64 -platform=darwin_arm64 -platform=darwin_amd64 -platform=windows_amd64
done
git diff --exit-code