From 0e2d2b268a101e3cccce057c9506d3df58ef6531 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 6 Nov 2018 16:08:02 +0000 Subject: Handle github_event 'ping' --- modules/github.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/github.py b/modules/github.py index b3276647..b72421d5 100644 --- a/modules/github.py +++ b/modules/github.py @@ -11,6 +11,10 @@ class Module(ModuleManager.BaseModule): def github(self, event): data = json.loads(event["data"]) + github_event = event["headers"]["X-GitHub-Event"] + if github_event == "ping": + return True + full_name = data["repository"]["full_name"] hooks = self.bot.database.channel_settings.find_by_setting( "github-hook") @@ -21,8 +25,6 @@ class Module(ModuleManager.BaseModule): if not hooks: return None - github_event = event["headers"]["X-GitHub-Event"] - outputs = None if github_event == "push": outputs = self.push(event, full_name, data) -- cgit v1.3.1-10-gc9f91