wda
This commit is contained in:
parent
f986b436e0
commit
42186a3d73
17
main.py
17
main.py
@ -801,12 +801,23 @@ async def handle_pr_synchronize(payload: dict[str, Any]) -> None:
|
||||
return
|
||||
author_login = (pull_request.get("user") or {}).get("login") or ""
|
||||
msg = f"В PR {repo_full_name}#{pr_number} добавлены новые коммиты (автор: {author_login})."
|
||||
for chat_id in await get_pr_participant_chat_ids(
|
||||
recipient_chat_ids = await get_pr_participant_chat_ids(
|
||||
repo_full_name,
|
||||
int(pr_number),
|
||||
pull_request=pull_request,
|
||||
exclude_login=author_login,
|
||||
):
|
||||
)
|
||||
if not recipient_chat_ids:
|
||||
log_warn(
|
||||
f"[notify] synchronize без получателей для {repo_full_name}#{pr_number}. "
|
||||
f"author={author_login}"
|
||||
)
|
||||
return
|
||||
log_info(
|
||||
f"[notify] synchronize для {repo_full_name}#{pr_number}, "
|
||||
f"получателей={len(recipient_chat_ids)}"
|
||||
)
|
||||
for chat_id in recipient_chat_ids:
|
||||
await telegram_client.send_message(chat_id, msg)
|
||||
|
||||
|
||||
@ -993,7 +1004,7 @@ async def gitea_webhook(
|
||||
await handle_pull_request_comment(payload)
|
||||
elif action in ("closed", "merged"):
|
||||
await handle_pr_closed(payload)
|
||||
elif action == "synchronize":
|
||||
elif action in ("synchronize", "synchronized"):
|
||||
await handle_pr_synchronize(payload)
|
||||
elif action == "reviewed" and payload.get("review"):
|
||||
await handle_pr_reviewed(payload)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user