Skip to content

Commit

Permalink
Update auto_cl.py
Browse files Browse the repository at this point in the history
  • Loading branch information
themanyfaceddemon authored Jun 27, 2024
1 parent a59fdd8 commit beb0f22
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions Tools/ATD/auto_cl.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,22 @@ def fetch_pr_data(token, repo, pr_number):
def fetch_single_pr(number):
try:
pr_info = get_pr_info(token, repo, number)

# Проверяем, что PR был замержен
if not pr_info.get('merged_at'):
return None

body = pr_info.get('body', '')

# Находим строку, которая начинается с :cl:
author = pr_info['user']['login']
for line in body.splitlines():
if line.strip().startswith(':cl:'):
potential_author = line.strip()[4:].strip() # Убираем :cl: и пробелы
if potential_author:
author = potential_author
break


# Извлекаем автора до конца строки
if cl_match:
author = cl_match.group(1).strip()
else:
author = pr_info['user']['login']


changes = []
for line in body.splitlines():
line = line.strip()
Expand All @@ -123,7 +118,7 @@ def fetch_single_pr(number):
changes.append({"message": line[len('- tweak:'):].strip(), "type": "Tweak"})
elif line.startswith('- fix:'):
changes.append({"message": line[len('- fix:'):].strip(), "type": "Fix"})

if changes:
return {
"author": author,
Expand Down

0 comments on commit beb0f22

Please sign in to comment.