Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Outline

github

Code to interact with the GitHub Rest API

See GitHub REST API documentation for more details.

CLI

python -m github create-jwt 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pem
python -m github get-access-token 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pem 56042046
python -m github get-app 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pem
python -m github get-app-installations 1027349 ~/.ssh/interactionapp.2024-10-16.private-key.pem
python -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)

Python Example (deleting all job runs from the rcolfin/python repo)

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.