Connectors
Repos · Issues · Pull requests
provider="github"

Connect GitHub

Let your Python automations work with repos, issues and pull requests as the GitHub user who runs them, through your own GitHub OAuth app.

· Setup essentials; a full guide is on its way

The github preset signs people in with a GitHub OAuth app, so each run acts as the person who started it, with access to the repos they can reach.

Declare the connection

import requests

from callables import Connection, Group

github = Connection("github", provider="github", scopes=["repo"])
gh = Group("github", title="GitHub", connections=[github])


@gh.deploy(title="My open pull requests")
def my_pull_requests() -> list[dict]:
    """Pull requests you opened that are still open."""
    resp = requests.get("https://api.github.com/search/issues",
                        headers={"Authorization": f"Bearer {github.token}", "Accept": "application/vnd.github+json"},
                        params={"q": "is:pr is:open author:@me"})
    resp.raise_for_status()
    return [{"title": i["title"], "url": i["html_url"]} for i in resp.json()["items"]]

Set up the OAuth app

  1. In GitHub, open Settings → Developer settings → OAuth Apps → New OAuth App. For an app your company owns, create it under the organization's settings instead.
  2. Set Authorization callback URL to https://callables.app/connections/callback.
  3. Register it, then Generate a new client secret. Copy the Client ID and the secret into your project's secrets as GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET, or the names you give client_id=Secret(...) and client_secret=Secret(...).
You want toScope
Read and write private and public reposrepo
Public repos onlypublic_repo
Read organization membershipread:org
Read the person's profileread:user

GitHub OAuth app tokens don't expire, so people stay connected until they revoke the app in their GitHub settings.

Testing locally

A GitHub OAuth app has a single callback URL. To use call connect, create a second OAuth app for local testing with the callback http://localhost:8765/callback, and put that app's ID and secret in .env.

A full step-by-step GitHub guide is on its way. Until then, the connections docs cover how connections work.

Run your scripts on each person's own account

Declare a connection, push, and share. Everyone connects once and every run uses their account.

Read the connections docs

Other connectors