API Reference

class github_webhook.Webhook(app, endpoint='/postreceive', secret=None)

Construct a webhook on the given app.

Parameters:
  • app – Flask app that will host the webhook
  • endpoint – the endpoint for the registered URL rule
  • secret – Optional secret, used to authenticate the hook comes from Github
hook(event_type='push')

Registers a function as a hook. Multiple hooks can be registered for a given type, but the order in which they are invoke is unspecified.

Parameters:event_type – The event type this hook will be invoked for.