From 580864797179bc33c6d0b005f53546318411079b Mon Sep 17 00:00:00 2001 From: sfalexrog Date: Tue, 13 Aug 2019 19:10:34 +0300 Subject: [PATCH] Use GitHub to generate changelogs (#160) * gen_changelog: Allow GitHub to generate changelog for us * Change format for auto changelog --- gen_changelog.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gen_changelog.py b/gen_changelog.py index 62e1ac28..6f332f39 100644 --- a/gen_changelog.py +++ b/gen_changelog.py @@ -57,10 +57,10 @@ except exc.GitCommandError: print('Base tag set to {}'.format(base_tag)) if base_tag == 'empty': - changelog = git.log('--pretty=format:* %H %s *(%an)*') + changelog_link = 'https://github.com/{}/commits'.format(repo_slug) else: - changelog = git.log('{}...{}'.format(base_tag, current_tag), '--pretty=format:* %H %s *(%an)*') -print('Current changelog: \n{}'.format(changelog)) + changelog_link = 'https://github.com/{}/compare/{}...{}'.format(repo_slug, base_tag, current_tag) +print('Current changelog: \n{}'.format(changelog_link)) # Only interact with Github if uploading is enabled if upload_changelog: @@ -77,7 +77,7 @@ if upload_changelog: gh_body = gh_release.body if gh_body is None: gh_body = '' - gh_body = '{}\nChanges between `{}` and `{}`:\n\n{}'.format(gh_body, base_tag, current_tag, changelog) + gh_body = '{}\nChanges between `{}` and `{}`: {}.'.format(gh_body, base_tag, current_tag, changelog_link) print('New release body: {}'.format(gh_body)) gh_release.update_release(gh_release.tag_name, gh_body, draft=True, prerelease=True, tag_name=gh_release.tag_name, target_commitish=gh_release.target_commitish)