@@ -1015,19 +1015,25 @@ jobs:
1015
1015
fi
1016
1016
1017
1017
# Create JSON object for this binary
1018
- binary_json=$(cat <<EOF
1019
- {
1020
- " filename " : " $filename" ,
1021
- " size " : $size,
1022
- " php_version " : " $php_version" ,
1023
- " platform " : " $platform" ,
1024
- " architecture " : " $architecture" ,
1025
- " configuration " : " $configuration" ,
1026
- " built_at " : " $(date -u +%Y-%m-%dT%H:%M:%SZ)" ,
1027
- " extensions " : " $(cat temp_metadata.json | jq -r '.extensions // " " ' 2>/dev/null || echo '')"
1028
- }
1029
- EOF
1030
- )
1018
+ binary_json=$(jq -n \
1019
+ --arg filename "$filename" \
1020
+ --arg size "$size" \
1021
+ --arg php_version "$php_version" \
1022
+ --arg platform "$platform" \
1023
+ --arg architecture "$architecture" \
1024
+ --arg configuration "$configuration" \
1025
+ --arg built_at "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
1026
+ --arg extensions "$(cat temp_metadata.json | jq -r '.extensions // ""' 2>/dev/null || echo '')" \
1027
+ '{
1028
+ filename: $filename,
1029
+ size: ($size | tonumber),
1030
+ php_version: $php_version,
1031
+ platform: $platform,
1032
+ architecture: $architecture,
1033
+ configuration: $configuration,
1034
+ built_at: $built_at,
1035
+ extensions: $extensions
1036
+ }')
1031
1037
1032
1038
# Add this binary to the array using jq
1033
1039
jq --argjson binary "$binary_json" '. += [$binary]' binaries_array.json > temp_array.json
0 commit comments