Fix bake jq conditionals

This commit is contained in:
estebanthi
2026-01-04 18:47:44 +01:00
parent cbb6163cc2
commit 50e0f562a3

View File

@@ -188,8 +188,8 @@ jobs:
tags: $tags,
args: $args
}
+ ( ($target != "" and $target != "null") ? {target: $target} : {} )
+ ( ($cache_ref != "") ? {"cache-from": ["type=registry,ref=" + $cache_ref], "cache-to": ["type=registry,ref=" + $cache_ref + ",mode=max"]} : {} )')
+ (if ($target != "" and $target != "null") then {target: $target} else {} end)
+ (if ($cache_ref != "") then {"cache-from": ["type=registry,ref=" + $cache_ref], "cache-to": ["type=registry,ref=" + $cache_ref + ",mode=max"]} else {} end)')
TARGETS_JSON=$(jq -n --arg name "$TARGET_NAME" --argjson target "$TARGET_OBJ" --argjson targets "$TARGETS_JSON" '$targets + {($name): $target}')
done < <(echo "$group" | jq -c 'to_entries[]')