Use awk for arch_list extraction to match build_from approach

Replace fragile sed '/^arch:/,/^[^ a]/p' pattern with the same
awk block-parsing approach used for build_from. The sed pattern
leaked lines from keys starting with 'a' (like audio:) into the
range before grep filtered them out. The awk approach cleanly
stops at the next top-level key.

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/d3d7f769-ce2d-4ddd-b066-7bb769754460
This commit is contained in:
copilot-swe-agent[bot]
2026-03-26 07:29:14 +00:00
parent f0f2a521b0
commit e92843eb36

View File

@@ -167,7 +167,11 @@ jobs:
image=$(grep -m1 '^image:' "config.$ext" | sed 's/^image:[[:space:]]*//' | tr -d "\"'")
name=$(grep -m1 '^name:' "config.$ext" | sed 's/^name:[[:space:]]*//' | tr -d "\"'")
description=$(grep -m1 '^description:' "config.$ext" | sed 's/^description:[[:space:]]*//' | tr -d "\"'")
arch_list=$(sed -n '/^arch:/,/^[^ a]/p' "config.$ext" | grep '^ *-' | sed 's/^ *- *//' | tr -d "\"'" | jq -R -s -c 'split("\n") | map(select(length > 0))')
arch_list=$(awk '
/^arch:/ { inblock=1; next }
/^[^[:space:]]/ { if (inblock) exit }
inblock && /^[[:space:]]/ { print }
' "config.$ext" | sed 's/^ *- *//' | tr -d "\"'" | jq -R -s -c 'split("\n") | map(select(length > 0))')
fi
break
fi