def add_hook(self, user, repo, name, config, events=None, active=True):
        try:
            hook = self.repo(user, repo).create_hook(name, config, events, active)
        except github3.GitHubError:
            # TODO Handle this case - if '20 hooks' in e.errors[0].get('message'):
            return None
        else:
            return hook
Create a webhook.
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/addons/github/api.py/GitHubClient.add_hook