Optimise ‘send_changelog.py’

This commit is contained in:
Patryk Michalik
2021-06-09 19:20:38 +02:00
parent 6a18381a32
commit fe1ac158d8
+2 -1
View File
@@ -15,7 +15,7 @@ commits_range = f'{github_event_before}...{github_sha}'
commits = list(repository.iter_commits(commits_range))
overview_link = f'https://github.com/{github_repo}/compare/{commits_range}'
overview_link_tag = f'''<a href="{overview_link}">{len(commits)} new {'commit' if len(commits) == 1 else 'commits'}</a>'''
overview_link_tag = f'''<a href="{overview_link}">{len(commits)} new commit{'s' and len(commits) > 1}</a>'''
message = f'''<b>🔨 {overview_link_tag} to <code>lawnchair:{branch}</code>:</b>\n'''
for commit in commits:
@@ -32,4 +32,5 @@ data = {
'disable_web_page_preview': 'true',
'disable_notification': 'true'
}
r = requests.post(f'https://api.telegram.org/bot{telegram_ci_bot_token}/sendMessage', data)