You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/publish-snapshot.yml
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -73,10 +73,11 @@ jobs:
73
73
jq . "$OUT" || true
74
74
exit 1
75
75
fi
76
-
# ensure each object has id and name fields
77
-
if ! jq -e '.[0] | has("id") and has("name")' "$OUT" >/dev/null; then
78
-
echo "Snapshot entries appear to be missing required fields (id/name)"
79
-
jq '.[0]' "$OUT" || true
76
+
# ensure every object has non-empty string id and name fields
77
+
if ! jq -e 'all(.[]; (has("id") and has("name") and (.id|type=="string") and (.name|type=="string") and (.id != "") and (.name != "")))' "$OUT" >/dev/null; then
78
+
echo "Snapshot validation failed: one or more entries are missing required fields 'id' or 'name', or they are empty/non-string"
79
+
# Show up to first 5 offending entries
80
+
jq 'map(select( (has("id")|not) or (has("name")|not) or (.id|type!="string") or (.name|type!="string") or (.id=="") or (.name=="") )) | .[0:5]' "$OUT" || true
0 commit comments