File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -430,11 +430,18 @@ jobs:
430430 def truncate(text: str) -> str:
431431 return text[:limit] + ("..." if len(text) > limit else "")
432432
433+ def emit(text: str) -> None:
434+ stripped = text.strip()
435+ if not stripped:
436+ print("(response empty or fully redacted)")
437+ else:
438+ print(stripped)
439+
433440 try:
434441 data = json.loads(raw)
435442 except json.JSONDecodeError:
436443 cleaned = ''.join(ch if ch.isprintable() else '?' for ch in raw)
437- print (truncate(cleaned.replace("\n", " ")))
444+ emit (truncate(cleaned.replace("\n", " ")))
438445 sys.exit(0)
439446
440447 def scrub(value):
@@ -448,7 +455,7 @@ jobs:
448455 return value
449456
450457 sanitized = json.dumps(scrub(data), ensure_ascii=False)
451- print (truncate(sanitized.replace("\n", " ")))
458+ emit (truncate(sanitized.replace("\n", " ")))
452459 PY
453460
454461 echo "error=true" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments