aboutsummaryrefslogtreecommitdiff
path: root/modules/github
diff options
context:
space:
mode:
authorGravatar jesopo2019-01-22 20:49:31 +0000
committerGravatar jesopo2019-01-22 20:49:31 +0000
commita27b567ae1ad28ce73521c1709b1cf99fa005361 (patch)
tree49abc8a74e2d0283e052127fcf87d3e329a3b8cb /modules/github
parentHandle a situation where a repo full name isn't provided and there isn't one set (diff)
signature
Support handling `watch` event (repo being stared - misleading event name i
know) (github)
Diffstat (limited to 'modules/github')
-rw-r--r--modules/github/module.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/github/module.py b/modules/github/module.py
index e2bee336..039ab1f6 100644
--- a/modules/github/module.py
+++ b/modules/github/module.py
@@ -50,6 +50,11 @@ EVENT_CATEGORIES = {
],
"team": [
"membership"
+ ],
+ "star": [
+ # "watch" is a misleading name for this event so this add "star" as an
+ # alias for "watch"
+ "watch"
]
}
@@ -314,6 +319,8 @@ class Module(ModuleManager.BaseModule):
outputs = self.ping(event, data)
elif github_event == "membership":
outputs = self.membership(event, organisation, data)
+ elif github_event == "watch":
+ outputs = self.watch(event, data)
if outputs:
for server, channel in targets:
@@ -515,3 +522,6 @@ class Module(ModuleManager.BaseModule):
return ["%s %s %s to team %s" %
(data["sender"]["login"], data["action"], data["member"]["login"],
data["team"]["name"])]
+
+ def watch(self, event, data):
+ return ["%s starred the repository" % data["sender"]["login"])