From 6611bcf27a06686ca1921f90294a9fafd44c56a9 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Tue, 9 Nov 2021 17:58:55 +0800 Subject: [PATCH] Fix report for dingtalk --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 19377f2..da3f461 100755 --- a/main.py +++ b/main.py @@ -222,8 +222,8 @@ def create_pr(comm_repo, ent_repo, comm_ci, org_members): return (True, new_pr.number) except Exception as e: - print(e) - return (False, -1) + print(">>> Fail to merge PR {}, cause: {}".format(comm_ci.pr_num, e)) + return (False, -1 if new_pr is None else new_pr.number) def get_org_name(repo): @@ -266,6 +266,7 @@ def main(community_repo, enterprise_repo): succ_prs = '\n\n'.join(succ_pr_list) if succ_pr_list else "None" err_prs = '\n\n'.join(err_pr_list) if err_pr_list else "None" + print(">>> Enable dingtalk notification: {}".format(enable_dingtalk_notification)) if enable_dingtalk_notification and (len(succ_pr_list) > 0 or len(err_pr_list) > 0): text = f"### Auto Merge Status\nMerge successfully:\n\n{succ_prs}\n\nFailed to merge:\n\n{err_prs}" dingtalk_bot.send_markdown(title='Auto Merge Status', text=text, is_at_all=False)