From e4796bceb1a5ddfcdf0d3c284cae14a4e555bed6 Mon Sep 17 00:00:00 2001 From: Jason Huebert Date: Thu, 24 Sep 2026 14:35:00 -0500 Subject: [PATCH] ci: strip carriage returns from target list in filter-build validate step The FIRMWARE_TARGETS repo variable contains CRLF line endings, so every target name carries a trailing \r and the validate step rejects the first entry ('Unknown build target'). Strip \r before splitting on spaces/commas/newlines in both the validation loop and the JSON array conversion. --- .github/workflows/filter-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/filter-build.yml b/.github/workflows/filter-build.yml index 1a995931..e4058150 100644 --- a/.github/workflows/filter-build.yml +++ b/.github/workflows/filter-build.yml @@ -293,7 +293,7 @@ jobs: sh build.sh list > /tmp/known-targets.txt # fail hard on unknown names instead of silently skipping them - for target in $(echo "$TARGETS" | tr ' ,' '\n'); do + for target in $(echo "$TARGETS" | tr -d '\r' | tr ' ,' '\n'); do [ -z "$target" ] && continue if ! grep -qx "$target" /tmp/known-targets.txt; then echo "Unknown build target: '$target'" >&2 @@ -302,7 +302,7 @@ jobs: done # convert targets separated by comma/newline into a json array string - JSON_ARRAY=$(echo "$TARGETS" | tr ' ,' '\n' | sed '/^$/d' | jq -R -s -c 'split("\n") | map(select(length > 0))') + JSON_ARRAY=$(echo "$TARGETS" | tr -d '\r' | tr ' ,' '\n' | sed '/^$/d' | jq -R -s -c 'split("\n") | map(select(length > 0))') echo "targets=$JSON_ARRAY" >> $GITHUB_OUTPUT