Code to interact with the GitHub Rest API
See GitHub REST API documentation for more details.
python -m github create-jwt 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pempython -m github get-access-token 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pem 56042046python -m github get-app 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pempython -m github get-app-installations 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pempython -m github delete-workflow-runs $(whoami) catholic-mass-readings $(python -m github get-access-token 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pem 56042046)python -m github list-workflow-runs $(whoami) pre-commit-hooks $(python -m github get-access-token 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pem 56042046)import json
from getpass import getuser
from pathlib import Path
import github
client_id = "1027349"
installation_id = "56042046"
signing_key = "~/.ssh/interactionapp.2024-10-16.private-key.pem"
owner = getuser()
async with (
github.providers.Application(
client_id, Path(signing_key).expanduser().read_bytes(), installation_id
) as provider,
github.GitHub(provider) as client,
):
workflows = client.workflows(owner, "python")
async for workflow in workflows:
print(json.dumps(workflow, indent=True)) # noqa: T201