mirror of
https://github.com/jhuebert/MeshCore.git
synced 2026-12-03 10:54:13 +00:00
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.
This commit is contained in:
1 parent
32b8d4bdf5
commit
e4796bceb1
1 file changed
+2
-2
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user