Skip to content

Commit 88072c4

Browse files
author
sevastian.zhukov
committed
fix script
1 parent 28a1cff commit 88072c4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/changelog/assemble_changelog.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_changes(path):
3333
issues = get_changes('changelog/unreleased/issues/')
3434
other = get_changes('changelog/unreleased/other/')
3535

36-
changelog = '# Changelog' \
36+
changelog = '# Changelog\n' + \
3737
'#### Features\n' + features + '\n\n' + \
3838
'#### Bug fixes and improvements\n' + bugfixes + '\n\n' + \
3939
'#### Known issues :warning:\n' + issues + '\n\n' + \
@@ -47,17 +47,18 @@ def get_changes(path):
4747
#
4848
# print(auto_changelog)
4949

50-
comments_url = 'https://api.github.com/repos/mapbox/mapbox-navigation-android/pulls/' + pr_number + '/comments'
50+
pr_comments_url = 'https://api.github.com/repos/mapbox/mapbox-navigation-android/issues/' + pr_number + '/comments'
5151
headers = {"Authorization": "Bearer " + token}
52-
comments = requests.get(comments_url, headers=headers).json()
52+
comments = requests.get(pr_comments_url, headers=headers).json()
5353

5454
comment_with_changelog_id = None
5555
for comment in comments:
5656
if comment['body'].startswith('# Changelog'):
5757
comment_with_changelog_id = comment['id']
5858

5959
if comment_with_changelog_id:
60-
comment_url = comments_url + '/' + comment_with_changelog_id
60+
comments_url = 'https://api.github.com/repos/mapbox/mapbox-navigation-android/issues/comments/'
61+
comment_url = comments_url + str(comment_with_changelog_id)
6162
requests.patch(comment_url, json={'body': changelog}, headers=headers)
6263
else:
63-
requests.post(comments_url, json={'body': changelog}, headers=headers)
64+
requests.post(pr_comments_url, json={'body': changelog}, headers=headers)

0 commit comments

Comments
 (0)