diff options
| author | 2019-03-07 08:35:29 +0000 | |
|---|---|---|
| committer | 2019-03-07 08:35:29 +0000 | |
| commit | b9fa74dbb51b674e56af285442c40d1c943af817 (patch) | |
| tree | e13ea0d35ff7995fb28c645baa72b5585cd8dde5 /modules/github | |
| parent | Only print ANSI reset characters when appropriate (diff) | |
| signature | ||
Move PR number into/after action for pull_request events
Diffstat (limited to 'modules/github')
| -rw-r--r-- | modules/github/__init__.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/github/__init__.py b/modules/github/__init__.py index 890ec57b..7f2aa9e3 100644 --- a/modules/github/__init__.py +++ b/modules/github/__init__.py @@ -495,28 +495,30 @@ class Module(ModuleManager.BaseModule): number = utils.irc.color("#%s" % data["pull_request"]["number"], COLOR_ID) action = data["action"] - action_desc = action + action_desc = "%s %s" % (action, number) branch = data["pull_request"]["base"]["ref"] colored_branch = utils.irc.color(branch, COLOR_BRANCH) if action == "opened": - action_desc = "requested merge into %s" % colored_branch + action_desc = "requested %s merge into %s" % (number, + colored_branch) elif action == "closed": if data["pull_request"]["merged"]: - action_desc = "%s into %s" % ( - utils.irc.color("merged", COLOR_POSITIVE), + action_desc = "%s %s into %s" % ( + utils.irc.color("merged", COLOR_POSITIVE), number, colored_branch) else: - action_desc = utils.irc.color("closed without merging", - COLOR_NEGATIVE) + action_desc = "%s %s %s" % ( + utils.irc.color("closed", COLOR_NEGATIVE), number, + utils.irc.color("without merging", COLOR_NEGATIVE)) elif action == "synchronize": - action_desc = "committed to" + action_desc = "committed to %s" % number pr_title = data["pull_request"]["title"] author = utils.irc.bold(data["sender"]["login"]) url = self._short_url(data["pull_request"]["html_url"]) - return ["[PR %s] %s %s: %s - %s" % ( - number, author, action_desc, pr_title, url)] + return ["[PR] %s %s: %s - %s" % ( + author, action_desc, pr_title, url)] def pull_request_review(self, full_name, data): if data["review"]["state"] == "commented": |
