diff --git a/.github/workflows/migrate-s3.yaml b/.github/workflows/migrate-s3.yaml index 28bed3b..2cf3a61 100644 --- a/.github/workflows/migrate-s3.yaml +++ b/.github/workflows/migrate-s3.yaml @@ -65,13 +65,13 @@ jobs: prefixes=$(kubectl exec $SERVICE_POD_NAME -- aws s3api list-objects-v2 --bucket $SRC_BUCKET --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text) # remove all spaces and put one comma between prefixes - cleaned_prefixes=$(echo $prefixes | tr ' ' ',') + cleaned_prefixes=$(echo $prefixes | tr -s '[:space:]' ',') DIRS="" IFS=',' for prefix in $cleaned_prefixes; do DIR=$(kubectl exec $SERVICE_POD_NAME -- aws s3api list-objects-v2 --bucket $SRC_BUCKET --prefix "$prefix" --delimiter '/' --query 'CommonPrefixes[*].Prefix' --output text) if [ -n "$DIR" ]; then - DIR=$(echo $DIR | tr ' ' ',') + DIR=$(echo $DIR | tr -s '[:space:]' ',') DIRS="${DIRS}${DIR}," fi done