aboutsummaryrefslogtreecommitdiff
path: root/modules/github.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-12-09 20:57:29 +0000
committerGravatar jesopo2018-12-09 20:57:29 +0000
commit6dc58d4ceb0b52c2094c265ddda43b5a04b3355e (patch)
tree66972b5433bda45682d871b35ded7792c866bfd8 /modules/github.py
parentShow newly added labels when a pull request is labeled (diff)
signature
Correctly support labeling pull requests, support unlabeling pull requests and support both on issues
Diffstat (limited to 'modules/github.py')
-rw-r--r--modules/github.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/github.py b/modules/github.py
index 9c6ccd13..a265a0ce 100644
--- a/modules/github.py
+++ b/modules/github.py
@@ -178,7 +178,9 @@ class Module(ModuleManager.BaseModule):
elif action == "synchronize":
action_desc = "committed to"
elif action == "labeled":
- action_desc = "labeled as '%s'" % data["pull_request"]["labels"][-1]
+ action_desc = "labeled as '%s'" % data["label"]["name"]
+ elif action == "unlabeled":
+ action_desc = "unlabeled as '%s'" % data["label"]["name"]
pr_title = data["pull_request"]["title"]
author = utils.irc.bold(data["sender"]["login"])
@@ -206,6 +208,12 @@ class Module(ModuleManager.BaseModule):
def issues(self, event, full_name, data):
action = data["action"]
+ action_desc = action
+ if action == "labeled":
+ action_desc = "labeled as '%s'" % data["label"]["name"]
+ elif action == "unlabeled":
+ action_desc = "unlabeled as '%s'" % data["label"]["name"]
+
issue_title = data["issue"]["title"]
author = utils.irc.bold(data["sender"]["login"])
url = data["issue"]["html_url"]