Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix report for dingtalk #8

Merged
merged 1 commit into from
Nov 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down