From c2ef675bf0b56927d512f65ccc3136f02d69555d Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 20 Nov 2018 10:27:28 +0000 Subject: [PATCH] Better descript opened pull requests (github.py) --- modules/github.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/github.py b/modules/github.py index 9a2ea036..3c7a0a72 100644 --- a/modules/github.py +++ b/modules/github.py @@ -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)