aboutsummaryrefslogtreecommitdiff
path: root/modules/github.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-11-06 14:55:47 +0000
committerGravatar jesopo2018-11-06 14:55:47 +0000
commit12bc12e2ab9806961fce0e9abcbf64759f0c4c7d (patch)
tree597c0d39245827a98f0c965d84e3118c80ba588d /modules/github.py
parentOnly count a `None` response from an API event hook to be a 404 (diff)
signature
issue_comment is fired for both issue comments AND pull request comments.
weirdly.
Diffstat (limited to 'modules/github.py')
-rw-r--r--modules/github.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/github.py b/modules/github.py
index 3683cef3..4b9e1614 100644
--- a/modules/github.py
+++ b/modules/github.py
@@ -119,9 +119,17 @@ class Module(ModuleManager.BaseModule):
(full_name, issue_number, author, action, issue_title, url)]
def issue_comment(self, event, full_name, data):
action = data["action"]
- issue_number = data["issue"]["number"]
- issue_title = data["issue"]["title"]
+
+ number = None
+ title = None
+ if "issue" in data:
+ number = data["issue"]["number"]
+ title = data["issue"]["title"]
+ elif "pull_request" in data:
+ number = data["pull_request"]["number"]
+ title = data["pull_request"]["title"]
+
commenter = data["comment"]["user"]["login"]
url = data["comment"]["html_url"]
return ["(%s) [issue#%d] %s %s a comment: %s - %s" %
- (full_name, issue_number, commenter, action, issue_title, url)]
+ (full_name, number, commenter, action, title, url)]