diff options
| author | 2019-10-18 13:31:21 +0100 | |
|---|---|---|
| committer | 2019-10-18 13:31:21 +0100 | |
| commit | 2b4f5dc75be3c46f6aa3ed07cbe97149db2cf5ba (patch) | |
| tree | a633bde892a7fe861c87b9fcac8147145f43764d /modules/git_webhooks | |
| parent | show merge_request/merge events (diff) | |
| signature | ||
correctly color/phrase opened, closed and merged for MRs
Diffstat (limited to 'modules/git_webhooks')
| -rw-r--r-- | modules/git_webhooks/gitlab.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/modules/git_webhooks/gitlab.py b/modules/git_webhooks/gitlab.py index cf0923c7..20bd7592 100644 --- a/modules/git_webhooks/gitlab.py +++ b/modules/git_webhooks/gitlab.py @@ -124,8 +124,8 @@ class GitLab(object): def merge_request(self, full_name, data): number = utils.irc.color("!%s" % data["object_attributes"]["iid"], colors.COLOR_ID) - action = ISSUE_ACTIONS[data["object_attributes"]["action"]] - action_desc = "%s %s" % (action, number) + action = data["object_attributes"]["action"] + action_desc = "%s %s" % (ISSUE_ACTIONS[action], number) branch = data["object_attributes"]["target_branch"] colored_branch = utils.irc.color(branch, colors.COLOR_BRANCH) @@ -133,13 +133,12 @@ class GitLab(object): action_desc = "requested %s merge into %s" % (number, colored_branch) elif action == "close": - if data["pull_request"]["merged"]: - action_desc = "%s %s into %s" % ( - utils.irc.color("merged", colors.COLOR_POSITIVE), number, - colored_branch) - else: - action_desc = "%s %s" % ( - utils.irc.color("closed", colors.COLOR_NEGATIVE), number) + action_desc = "%s %s" % ( + utils.irc.color("closed", colors.COLOR_NEGATIVE), number) + elif action == "merge": + action_desc = "%s %s into %s" % ( + utils.irc.color("merged", colors.COLOR_POSITIVE), number, + colored_branch) pr_title = data["object_attributes"]["title"] author = utils.irc.bold(data["user"]["username"]) |
