fixed issue with yq syntax (need to wrap .key, .value in braces otherwise ',' breaks priority

This commit is contained in:
v.karaychentsev
2026-02-10 20:04:11 +03:00
parent bab01172b9
commit 27a9663f94

View File

@@ -32,7 +32,7 @@ for service_dir in ./*/; do
install -d -m "$DIR_MODE" -o root -g "$SECRETS_GROUP" -- "$out_dir" install -d -m "$DIR_MODE" -o root -g "$SECRETS_GROUP" -- "$out_dir"
sops -d "$secrets_file" \ sops -d "$secrets_file" \
| yq -r -0 'to_entries[] | "\(.key)\u0000\(.value)\u0000"' \ | yq -r -0 'to_entries[] | [.key, .value] | .[]' \
| while IFS= read -r -d '' key && IFS= read -r -d '' value; do | while IFS= read -r -d '' key && IFS= read -r -d '' value; do
[[ "$key" =~ ^[A-Za-z0-9_][-A-Za-z0-9_]*$ ]] || { echo "skip bad key: $key" >&2; continue; } [[ "$key" =~ ^[A-Za-z0-9_][-A-Za-z0-9_]*$ ]] || { echo "skip bad key: $key" >&2; continue; }