@@ -80,46 +80,6 @@ check_png_naming() {
8080 fi
8181}
8282
83- check_terraform_files () {
84- local buildingblock_path=" $1 "
85-
86- # Check for at least one .tf file (excluding .terraform subfolder)
87- if ! find " $buildingblock_path " -maxdepth 1 -type f -name ' *.tf' | grep -q . ; then
88- errors+=(" No Terraform (.tf) files found in $buildingblock_path " )
89- return 1
90- fi
91-
92- # Optional recommended file check
93- local recommended_tf_files=(" main.tf" " variables.tf" " outputs.tf" , " provider.tf" " versions.tf" )
94- for tf_file in " ${recommended_tf_files[@]} " ; do
95- if [[ ! -f " $buildingblock_path /$tf_file " ]]; then
96- warnings+=(" Recommended file '$tf_file ' is missing in $buildingblock_path " )
97- fi
98- done
99-
100- # Run terraform init + validate with visible output
101- pushd " $buildingblock_path " > /dev/null || return 1
102- rm -rf .terraform/ > /dev/null 2>&1
103-
104- echo " 🔄 Running terraform init in $buildingblock_path "
105- if ! terraform init -backend=false -input=false; then
106- echo -e " ❌ ${RED} Terraform init failed in $buildingblock_path ${NC} "
107- errors+=(" Terraform init failed in $buildingblock_path " )
108- popd > /dev/null
109- return 1
110- fi
111-
112- echo " 🔄 Running terraform validate in $buildingblock_path "
113- if terraform validate; then
114- echo -e " ✅ ${buildingblock_path} validated successfully"
115- else
116- echo -e " ❌ ${RED} Terraform validate failed in $buildingblock_path ${NC} "
117- errors+=(" Terraform validate failed in $buildingblock_path " )
118- fi
119-
120- popd > /dev/null
121- }
122-
12383# Ensure script is run from repo root
12484cd " $( dirname " $0 " ) /.." || exit 1
12585modules_path=" modules"
@@ -141,10 +101,10 @@ for png_file in $(find $modules_glob -maxdepth 1 -name '*.png'); do
141101 check_png_naming " $png_file "
142102done
143103
144- Check each buildingblock directory
145- for buildingblock_dir in $( find $modules_glob -type d -name ' buildingblock' ) ; do
146- check_terraform_files " $buildingblock_dir "
147- done
104+ # Check each buildingblock directory
105+ # for buildingblock_dir in $(find $modules_glob -type d -name 'buildingblock'); do
106+ # check_terraform_files "$buildingblock_dir"
107+ # done
148108
149109# Output summary
150110echo " "
@@ -168,18 +128,3 @@ else
168128 echo " ✅ All checks passed successfully."
169129 exit 0
170130fi
171-
172- if [[ -n " $GITHUB_STEP_SUMMARY " ]]; then
173- {
174- echo " ## 🧪 Module Validation Summary"
175- echo " "
176- echo " **Errors:** ${# errors[@]} "
177- for e in " ${errors[@]} " ; do echo " - ❌ $e " ; done
178- echo " "
179- echo " **Warnings:** ${# warnings[@]} "
180- for w in " ${warnings[@]} " ; do echo " - ⚠️ $w " ; done
181- if [[ ${# errors[@]} -eq 0 && ${# warnings[@]} -eq 0 ]]; then
182- echo " - ✅ All checks passed successfully."
183- fi
184- }
185- fi
0 commit comments