From a27b567ae1ad28ce73521c1709b1cf99fa005361 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 22 Jan 2019 20:49:31 +0000 Subject: Support handling `watch` event (repo being stared - misleading event name i know) (github) --- modules/github/module.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/github') 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"]) -- cgit v1.3.1-10-gc9f91