@@ -80,46 +80,6 @@ check_png_naming() {
80
80
fi
81
81
}
82
82
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
-
123
83
# Ensure script is run from repo root
124
84
cd " $( dirname " $0 " ) /.." || exit 1
125
85
modules_path=" modules"
@@ -141,10 +101,10 @@ for png_file in $(find $modules_glob -maxdepth 1 -name '*.png'); do
141
101
check_png_naming " $png_file "
142
102
done
143
103
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
148
108
149
109
# Output summary
150
110
echo " "
@@ -168,18 +128,3 @@ else
168
128
echo " ✅ All checks passed successfully."
169
129
exit 0
170
130
fi
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