From dcc456d18bf3671e0f5e2972305fe9f4a6191f9b Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sun, 14 Dec 2025 00:00:54 -0600 Subject: [PATCH] refactor: enhance Docker Compose validation workflow to improve error handling - Replaced the pipe with an array to handle directory names, ensuring that errors within the loop propagate correctly to the parent shell. - Updated the loop structure for better reliability in processing the directories. --- .github/workflows/validate-docker-compose.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-docker-compose.yml b/.github/workflows/validate-docker-compose.yml index 792b3703..ddd16aab 100644 --- a/.github/workflows/validate-docker-compose.yml +++ b/.github/workflows/validate-docker-compose.yml @@ -192,7 +192,11 @@ jobs: exit 0 fi - echo "$DIRECTORIES" | while read -r template_dir; do + # Convert to array to avoid subshell issues with pipe + # This ensures ERROR=1 inside the loop propagates to the parent shell + mapfile -t DIRS_ARRAY <<< "$DIRECTORIES" + + for template_dir in "${DIRS_ARRAY[@]}"; do if [ -z "$template_dir" ]; then continue fi