Handle github_event 'ping'
This commit is contained in:
parent
7c49152ef6
commit
0e2d2b268a
1 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue