Skip to content

github_handler

appimage_updater.repositories.handlers.github_handler

GitHub repository handler implementation.

GitHubHandler

Handler for GitHub repositories.

metadata property

Get GitHub handler metadata.

can_handle_url(url)

Check if this handler can handle the given URL.

Source code in src/appimage_updater/repositories/handlers/github_handler.py
def can_handle_url(self, url: str) -> bool:
    """Check if this handler can handle the given URL."""
    # Check if URL matches GitHub patterns
    if (
        url.startswith("https://github.com/")
        or url.startswith("http://github.com/")
        or self.metadata.can_handle_url_pattern(url)
    ):
        return True

    # For probing mode, also try known GitHub-compatible domains
    # This allows discovery of GitHub-compatible instances like Codeberg, Gitea, etc.
    known_compatible_domains = [
        "codeberg.org",
        "gitea.com",
        "git.sr.ht",
        "gitlab.com",  # GitLab has GitHub-compatible API endpoints
    ]

    return any(f"://{domain}/" in url for domain in known_compatible_domains)

create_client(**kwargs)

Create a GitHub repository client.

Source code in src/appimage_updater/repositories/handlers/github_handler.py
def create_client(self, **kwargs: Any) -> RepositoryClient:
    """Create a GitHub repository client."""
    return GitHubRepository(**kwargs)