V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 2m12s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-10-24 22:20:46 +01:00
parent c150e90579
commit 06b59142c3

View File

@@ -162,9 +162,18 @@ yaml_secret() {
# -0 : NUL between *each* result # -0 : NUL between *each* result
# shellcheck disable=SC2016,SC2312 # shellcheck disable=SC2016,SC2312
exec {__pipe_fd}< <( exec {__pipe_fd}< <(
yq -r -N -0 'leaf_paths as $p yq -r -N -0 '
| select($p[0]=="secrets" and $p[-1]=="value") def emit($p; $v):
| ($p[0:-1] | join(".")), ((getpath($p)//"") | tostring) if ($v|type) == "object" then
($v | to_entries[] | emit(($p + (if $p=="" then "" else "." end) + .key); .value))
elif ($v|type) == "array" then
(range(0; ($v|length)) | emit(($p + "[" + (tostring) + "]"); $v[.]))
else
if ($p | endswith(".value")) then
($p | sub("\\.value$"; "")), (($v // "") | tostring)
else empty end
end;
(.secrets // empty) | emit("secrets"; .)
' -- "${secrets_yaml}" ' -- "${secrets_yaml}"
) )