From 1020d1f48f11ae6927ecfeacb2084fa311debfa9 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 1 Feb 2024 14:11:10 +0800 Subject: [PATCH] feat: sync issue and pull request --- server/tasks/lark/chat.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/server/tasks/lark/chat.py b/server/tasks/lark/chat.py index 64a4e3fc..afa98e28 100644 --- a/server/tasks/lark/chat.py +++ b/server/tasks/lark/chat.py @@ -339,16 +339,26 @@ def sync_issue( # 后面需要插入记录,再发卡片,创建话题 repository = github_app.get_repo_info_by_name(team.name, repo.name) if is_pr: - pull_request = github_app.get_one_pull_requrst(team.name, repo.name, issue_id) + pull_request = github_app.get_one_pull_request(team.name, repo.name, issue_id) logging.debug("get_one_pull_requrst %r", pull_request) tasks.on_pull_request_opened( - {"action": "opened", "pull_request": pull_request, "repository": repository} + { + "action": "opened", + "sender": pull_request["user"], + "pull_request": pull_request, + "repository": repository, + } ) else: issue = github_app.get_one_issue(team.name, repo.name, issue_id) logging.debug("get_one_issue %r", issue) tasks.on_issue_opened( - {"action": "opened", "issue": issue, "repository": repository} + { + "action": "opened", + "sender": issue["user"], + "issue": issue, + "repository": repository, + } ) return send_chat_failed_tip(