From 2c1b8bfdf293aa2d265dd603e654364e0a3c76de Mon Sep 17 00:00:00 2001 From: The many faced demon <154847721+themanyfaceddemon@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:59:53 +0300 Subject: [PATCH] Update auto_cl.py --- Tools/ATD/auto_cl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Tools/ATD/auto_cl.py b/Tools/ATD/auto_cl.py index 030ca2039f4..98503a36cdd 100644 --- a/Tools/ATD/auto_cl.py +++ b/Tools/ATD/auto_cl.py @@ -91,18 +91,21 @@ def fetch_pr_data(token, repo, pr_number): def fetch_single_pr(number): try: pr_info = get_pr_info(token, repo, number) - logging.info(pr_info) + # Проверяем, что PR был замержен if not pr_info.get('merged_at'): return None body = pr_info.get('body', '') - cl_match = re.search(r':cl:\s*(.*?)(?:\r?\n|$)', body) + cl_match = re.search(r':cl:\s*(.*)$', body) if not cl_match: return None # Извлекаем автора до конца строки - author = cl_match.group(1).strip() or pr_info['user']['login'] + if cl_match: + author = cl_match.group(1).strip() + else: + author = pr_info['user']['login'] changes = [] for line in body.splitlines():