look out for the github event type
[git-mirror.git] / webhook.py
index 7935d8126169ef09c003438d5785f9046cd024aa..33cae3974c5b34c65030c4794a9a5ffe19f00276 100755 (executable)
@@ -46,5 +46,9 @@ query = urllib.parse.parse_qs(query)
 repository = query.get('repository', [])
 repository = repository[0] if len(repository) else ''
 
+# get GitHub metadata
+githubEvent = os.getenv('HTTP_X_GITHUB_EVENT')
+githubSignature = os.getenv('HTTP_X_HUB_SIGNATURE')
+
 # execute the actual script
-os.execlp("sudo", "sudo", "-n", "-u", "git", webhook_core, repository)
+os.execlp("sudo", "sudo", "-n", "-u", "git", webhook_core, repository, str(githubEvent), str(githubSignature))