diff --git a/scripts/ci_notify.py b/scripts/ci_notify.py index 2f615cab7..bdc6aeb8a 100644 --- a/scripts/ci_notify.py +++ b/scripts/ci_notify.py @@ -160,20 +160,20 @@ def main() -> int: try: with urllib.request.urlopen(req, timeout=10) as resp: resp_body = resp.read().decode("utf-8") - print(f"通知已发送 ({mode})") # 飞书返回code=0表示成功 try: result = json.loads(resp_body) if result.get("code", 0) != 0: - print(f"飞书返回错误: {result.get('msg', resp_body)}", file=sys.stderr) - return 1 + print(f"通知发送告警: 飞书返回错误 - {result.get('msg', resp_body)}", file=sys.stderr) + print(f"通知已发送 ({mode}) - 飞书返回非0,但不阻断CI流程") + else: + print(f"通知已发送 ({mode})") except json.JSONDecodeError: - pass + print(f"通知已发送 ({mode})") except Exception as e: - print(f"通知发送失败: {e}", file=sys.stderr) - # 通知失败不阻断CI主流程,仅打印告警 - return 0 + print(f"通知发送告警: {e}", file=sys.stderr) + # 通知无论成功失败都不阻断CI主流程,统一返回0 return 0