Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Commit

Permalink
Don't try to add empty PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jpopelka committed Jan 16, 2020
1 parent 9b9fe47 commit 3097b1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions release_bot/init_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
output_engine = mustache("markdown.tpl")
"""


class Init:
"""
Creates all of the required configuration script required for the ReleaseBot
Expand Down
12 changes: 7 additions & 5 deletions release_bot/releasebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ def release_handler(success):
try:
latest_release = self.github.latest_release()
except ReleaseException as exc:
raise ReleaseException(f"Failed getting latest {self.git_service.name} release (zip).\n{exc}")
raise ReleaseException(
f"Failed getting latest {self.git_service.name} release (zip).\n{exc}")

if Version.coerce(latest_release) >= Version.coerce(self.new_release.version):
self.logger.info(
Expand Down Expand Up @@ -257,7 +258,7 @@ def release_handler(success):
latest_pypi = self.pypi.latest_version()
if Version.coerce(latest_pypi) >= Version.coerce(self.new_release.version):
msg = f"{self.conf.pypi_project}-{self.new_release.version} " \
f"or higher version has already been released on PyPi"
f"or higher version has already been released on PyPi"
self.logger.info(msg)
return False
self.git.fetch_tags()
Expand Down Expand Up @@ -304,9 +305,10 @@ def run(self):
except ReleaseException as exc:
self.logger.error(exc)

msg = '\n'.join(self.github.comment)
self.project.pr_comment(self.new_release.pr_number, msg)
self.github.comment = [] # clean up
if self.github.comment:
msg = '\n'.join(self.github.comment)
self.project.pr_comment(self.new_release.pr_number, msg)
self.github.comment = [] # clean up

if not self.conf.refresh_interval:
self.logger.debug(
Expand Down

0 comments on commit 3097b1f

Please sign in to comment.