docs/integrations/prefect-github/api-ref/prefect_github-credentials.mdx
prefect_github.credentialsCredential classes used to perform authenticated interactions with GitHub
GitHubCredentials <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-github/prefect_github/credentials.py#L12" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Block used to manage GitHub authentication.
Attributes:
token: the token to authenticate into GitHub.Examples:
Load stored GitHub credentials:
from prefect_github import GitHubCredentials
github_credentials_block = GitHubCredentials.load("BLOCK_NAME")
Methods:
format_git_credentials <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-github/prefect_github/credentials.py#L35" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>format_git_credentials(self, url: str) -> str
Format and return the full git URL with GitHub credentials embedded.
GitHub uses plain token format without any prefix.
Args:
url: Repository URL (e.g., "https://github.com/org/repo.git")Returns:
Raises:
ValueError: If token is not configuredget_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-github/prefect_github/credentials.py#L58" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>get_client(self) -> HTTPEndpoint
Gets an authenticated GitHub GraphQL HTTPEndpoint client.
Returns: