Better descript opened pull requests (github.py)

This commit is contained in:
jesopo 2018-11-20 10:27:28 +00:00
parent c77ca64367
commit c2ef675bf0

View file

@ -159,12 +159,16 @@ class Module(ModuleManager.BaseModule):
def pull_request(self, event, full_name, data):
action = data["action"]
action_desc = action
if action == "closed":
branch = data["pull_request"]["base"]["ref"]
colored_branch = utils.irc.color(branch, utils.consts.LIGHTBLUE)
if action == "opened":
action_desc = "requested merge into %s" % colored_branch
elif action == "closed":
if data["pull_request"]["merged"]:
branch = data["pull_request"]["base"]["ref"]
action_desc = "%s into %s" % (
utils.irc.color("merged", utils.consts.GREEN),
utils.irc.color(branch, utils.consts.LIGHTBLUE))
colored_branch)
else:
action_desc = utils.irc.color("closed without merging",
utils.consts.RED)