def cli(payload_url, exclude_inactive):
    """
    List all repos with specified webhook payload URL.

    Note that you must set the environment variable $GITHUB_PERSONAL_TOKEN
    to a valid token that you create in GitHub.
    """
    repos = get_repos_with_webhook(payload_url,
                                   exclude_inactive=exclude_inactive)

    for repo in repos:
        click.echo(repo_name(repo))
def cli(payload_url):
    """
    Delete specified webhook from all repos.

    Note that you must set the environment variable $GITHUB_PERSONAL_TOKEN
    to a valid token that you create in GitHub.
    """
    repos = get_repos_with_webhook(payload_url)

    for repo in repos:
        hooks = list(get_webhooks(repo, payload_url))
        click.echo("Deleteing {} hook(s) from {}...".format(
            len(hooks), repo_name(repo)))
        delete_hooks(repo, hooks)
Esempio n. 3
0
def test_repo_name(repo):
    expected = 'owner/repo'
    assert repo_name(repo) == expected