From 6626f60a64f0677027fee1dadcde2091922bb452 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 9 Jul 2019 09:42:42 +0100 Subject: show new label for issue 'labeled' events --- modules/git_webhooks/github.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'modules/git_webhooks/github.py') diff --git a/modules/git_webhooks/github.py b/modules/git_webhooks/github.py index 8072a51e..4abc38fc 100644 --- a/modules/git_webhooks/github.py +++ b/modules/git_webhooks/github.py @@ -329,13 +329,18 @@ class GitHub(object): (sender, COMMENT_ACTIONS[action], number, pr_title, url)] def issues(self, full_name, data): - number = utils.irc.color("#%s" % data["issue"]["number"], colors.COLOR_ID) + number = utils.irc.color("#%s" % data["issue"]["number"], + colors.COLOR_ID) action = data["action"] + action_str = "%s %s" % (action, number) + if action == "labeled": + action_str = "labeled %s as '%s'" % (number, data["label"]["name"]) + issue_title = data["issue"]["title"] author = utils.irc.bold(data["sender"]["login"]) url = self._short_url(data["issue"]["html_url"]) - return ["[issue] %s %s %s: %s - %s" % - (author, action, number, issue_title, url)] + return ["[issue] %s %s: %s - %s" % + (author, action_str, issue_title, url)] def issue_comment(self, full_name, data): if "changes" in data: # don't show this event when nothing has actually changed -- cgit v1.3.1-10-gc9f91