Skip to content

Commit 5275266

Browse files
committed
Fix JSON paths: logs are under .result not top-level
1 parent 698b6a9 commit 5275266

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/worker-build-logs.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,24 @@ jobs:
8383
return
8484
fi
8585
86-
# Check if .lines exists
87-
has_lines=$(echo "$json" | jq 'has("lines")' 2>/dev/null || echo "false")
88-
echo "[DEBUG] has .lines key: $has_lines"
86+
# Check if .result.lines exists
87+
has_lines=$(echo "$json" | jq '.result | has("lines")' 2>/dev/null || echo "false")
88+
echo "[DEBUG] has .result.lines key: $has_lines"
8989
9090
# Check top-level keys
9191
echo "[DEBUG] top-level keys: $(echo "$json" | jq -r 'keys | join(", ")' 2>/dev/null || echo "PARSE ERROR")"
92+
echo "[DEBUG] result keys: $(echo "$json" | jq -r '.result | keys | join(", ")' 2>/dev/null || echo "PARSE ERROR")"
9293
93-
total_lines=$(echo "$json" | jq '.lines | length' 2>/dev/null || echo "0")
94+
total_lines=$(echo "$json" | jq '.result.lines | length' 2>/dev/null || echo "0")
9495
echo "[DEBUG] total_lines=$total_lines last_line_count=$last_line_count"
9596
9697
if [ "$total_lines" -gt "$last_line_count" ]; then
9798
echo "[DEBUG] printing lines from $last_line_count to $total_lines"
9899
# Print first line raw for debugging
99-
echo "[DEBUG] first new line raw: $(echo "$json" | jq --argjson skip "$last_line_count" '.lines[$skip:][0]' 2>/dev/null)"
100+
echo "[DEBUG] first new line raw: $(echo "$json" | jq --argjson skip "$last_line_count" '.result.lines[$skip:][0]' 2>/dev/null)"
100101
echo "$json" | jq -r \
101102
--argjson skip "$last_line_count" \
102-
'.lines[$skip:][] | .[1]'
103+
'.result.lines[$skip:][] | .[1]'
103104
jq_exit=$?
104105
echo "[DEBUG] jq exit code: $jq_exit"
105106
last_line_count=$total_lines
@@ -112,12 +113,12 @@ jobs:
112113
local json="$1"
113114
if [ -z "$json" ]; then return; fi
114115
115-
events_count=$(echo "$json" | jq '.events | length' 2>/dev/null || echo "0")
116+
events_count=$(echo "$json" | jq '.result.events | length' 2>/dev/null || echo "0")
116117
if [ "$events_count" -gt 0 ]; then
117118
echo ""
118119
echo "── Build Phases ──"
119120
echo "$json" | jq -r '
120-
.events[] |
121+
.result.events[] |
121122
.type as $type |
122123
(.started_on // null) as $start |
123124
(.ended_on // null) as $end |

0 commit comments

Comments
 (0)