Prefect Collection for interacting with GitHub in your flows: prefect-github

Docs

https://prefecthq.github.io/prefect-github/

Code

Examples

from prefect import flow
from prefect_github import GitHubCredentials
from prefect_github.repository import query_repository
from prefect_github.mutations import add_star_starrable


@flow()
async def github_add_star_flow():
    github_credentials = GitHubCredentials(token)
    repository_id_future = await query_repository(
        "PrefectHQ",
        "Prefect",
        github_credentials=github_credentials,
        return_fields="id"
    )
    repository_id = (await repository_id_future.result())["id"]
    starrable = await add_star_starrable(
        repository_id,
        github_credentials
    )
    return starrable


await github_add_star_flow()
1 Like