Skip to content

Commit 9d948c1

Browse files
committed
Extract line info from error message
1 parent 1cc577d commit 9d948c1

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

.github/workflows/json.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,21 @@ jobs:
4141
4242
- name: Validate JSON files
4343
if: steps.changed.outputs.files != ''
44+
shell: "bash {0}"
4445
run: |
4546
failed=0
4647
while read -r file; do
47-
[ -f "$file" ] || continue
48+
test -f "$file" || continue
4849
jq empty "$file" 2>err.log
4950
if [ $? -ne 0 ]; then
5051
msg=$(<err.log)
51-
echo "::error file=$file::${msg}"
52+
# Extract line number from jq error if present
53+
if grep -oE 'at line [0-9]+' err.log >/dev/null; then
54+
lineno=$(grep -oE 'at line [0-9]+' err.log | head -1 | grep -oE '[0-9]+')
55+
echo "::error file=$file,line=$lineno::$msg"
56+
else
57+
echo "::error file=$file::$msg"
58+
fi
5259
failed=1
5360
fi
5461
done <<< "${{ steps.changed.outputs.files }}"

lang/id.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@
332332
"fields": {
333333
"upcomingSchedules": "Upcoming Events"
334334
}
335+
},
336+
"timeTrials": {
337+
"label": "Time Trials",
338+
"fields": {
339+
"goalReached": "Goal Reached"
340+
}
335341
}
336342
}
337343
},
@@ -931,6 +937,9 @@
931937
"saveUpToDate": "Save data is up to date.",
932938
"saveCleared": "Save Sync data has been cleared. This will not affect existing saves on any of your devices.",
933939
"saveReminder": "Remember to save often and to backup your save files in order not to lose your progress."
940+
},
941+
"timeTrials": {
942+
"timeTrialsComplete": "Goal! {CATEGORY} completed in {TIME}."
934943
}
935944
},
936945
"events": {
@@ -1183,4 +1192,4 @@
11831192
}
11841193
}
11851194
}
1186-
}
1195+
}

lang/ja.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,4 +1192,4 @@
11921192
}
11931193
}
11941194
}
1195-
}
1195+
}

lang/ro.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@
312312
"timeTrials": {
313313
"label": "Time Trials",
314314
"fields": {
315-
"goalReached": "Goal Reached"
315+
"goalReached": "Goal Reached"
316+
}
316317
},
317318
"screenshots": {
318319
"label": "Screenshots",

0 commit comments

Comments
 (0)