Skip to content

Commit 3a3e525

Browse files
CCM-14029 Centralise Precommits & GHAs
1 parent 337eb3a commit 3a3e525

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/githooks/check-terraform-docs.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ function main() {
2626
# check_only=[do not format, run check only]
2727
function terraform-docs() {
2828

29+
# Skip if infrastructure/terraform/modules doesn't exist or is empty
30+
if [ ! -d "infrastructure/terraform/modules" ] || [ -z "$(ls -A infrastructure/terraform/modules 2>/dev/null)" ]; then
31+
echo "No Terraform modules found, skipping terraform-docs"
32+
return 0
33+
fi
34+
2935
make terraform-docs
30-
git add infrastructure/terraform/modules/**/*.md
36+
git add infrastructure/terraform/modules/**/*.md || true
3137
}
3238

3339
# ==============================================================================

0 commit comments

Comments
 (0)