Skip to content

Commit d97f544

Browse files
fix: update terraform test and validate scripts to skip if no changes detected
1 parent 84e96d8 commit d97f544

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scripts/terraform_test_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -euo pipefail
66
# ALL_CHANGED_FILES - all files changed in the PR (for logging)
77
# SHARED_CHANGED - boolean indicating if shared infrastructure changed
88
# MODULE_CHANGED_FILES - only files in registry/**/modules/** (for processing)
9-
# Runs all tests if shared infrastructure changes or if env vars are not set (local dev)
9+
# Runs all tests if shared infrastructure changes, or skips if no changes detected
1010
#
1111
# This script only runs tests for changed modules. Documentation and template changes are ignored.
1212

scripts/terraform_validate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -euo pipefail
77
# ALL_CHANGED_FILES - all files changed in the PR (for logging)
88
# SHARED_CHANGED - boolean indicating if shared infrastructure changed
99
# MODULE_CHANGED_FILES - only files in registry/**/modules/** (for processing)
10-
# Validates all modules if shared infrastructure changes or if env vars are not set (local dev)
10+
# Validates all modules if shared infrastructure changes, or skips if no changes detected
1111
#
1212
# This script only validates changed modules. Documentation and template changes are ignored.
1313

@@ -30,12 +30,12 @@ main() {
3030
fi
3131

3232
local script_dir=$(dirname "$(readlink -f "$0")")
33-
local registry_dir="$script_dir/../registry"
33+
local registry_dir=$(readlink -f "$script_dir/../registry")
3434

3535
if [[ "${SHARED_CHANGED:-false}" == "true" ]]; then
3636
echo "==> Shared infrastructure changed"
3737
echo "==> Validating all modules for safety"
38-
local subdirs=$(find "$registry_dir" -mindepth 3 -path "*/modules/*" -type d | sort)
38+
local subdirs=$(find "$registry_dir" -mindepth 3 -maxdepth 3 -path "*/modules/*" -type d | sort)
3939
elif [[ -z "${MODULE_CHANGED_FILES:-}" ]]; then
4040
echo "✓ No module files changed, skipping validation"
4141
exit 0

0 commit comments

Comments
 (0)