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/docs-quality.yml
+24-5Lines changed: 24 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -38,8 +38,22 @@ jobs:
38
38
import os
39
39
import sys
40
40
41
-
with open("cspell-report.json", encoding="utf-8") as f:
42
-
data = json.load(f)
41
+
try:
42
+
with open("cspell-report.json", encoding="utf-8") as f:
43
+
content = f.read().strip()
44
+
except FileNotFoundError:
45
+
content = ""
46
+
47
+
if not content:
48
+
print("::error::cspell-report.json is empty. Check the previous step's log for the actual cspell error (e.g. missing cspell.json or project-words.txt).")
49
+
sys.exit(1)
50
+
51
+
try:
52
+
data = json.loads(content)
53
+
except json.JSONDecodeError:
54
+
print("::error::cspell-report.json is not valid JSON. Raw output was:")
55
+
print(content[:2000])
56
+
sys.exit(1)
43
57
44
58
issues = data.get("issues", [])
45
59
for issue in issues:
@@ -54,12 +68,17 @@ jobs:
54
68
sys.exit(1 if issues and not allow_failure else 0)
0 commit comments