Commit 7450df55 authored by 方海彤's avatar 方海彤 👶🏻

fix: skip Feishu notification when no diff is found

Removes the Feishu notification step when there are no code changes to review. The process now simply prints a skip message and exits to reduce unnecessary notifications.
parent 71a89423
...@@ -48,18 +48,7 @@ def main(): ...@@ -48,18 +48,7 @@ def main():
diff_elapsed = time.time() - t_diff diff_elapsed = time.time() - t_diff
print(f" ⏱️ 阶段耗时 - 获取Diff: {format_duration(diff_elapsed)}") print(f" ⏱️ 阶段耗时 - 获取Diff: {format_duration(diff_elapsed)}")
if not diff.strip(): if not diff.strip():
print("没有需要审查的代码变更,跳过。") print("没有需要审查的代码变更,跳过通知。")
t_feishu = time.time()
send_feishu(
f"🤖 代码审查 - {project_name}/{branch}",
[
f"提交者: {committer}",
f"提交: {commit_sha_short} {commit_msg}",
"",
"✅ 没有需要审查的代码变更。",
]
)
print(f" ⏱️ 阶段耗时 - 飞书通知: {format_duration(time.time() - t_feishu)}")
print(f" ⏱️ 总耗时: {format_duration(time.time() - total_start)}") print(f" ⏱️ 总耗时: {format_duration(time.time() - total_start)}")
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment