Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to GitHub (Personal Access Token)

Scalekit connector
Open markdown

The GitHub (Personal Access Token) connector lets your AI agent act in each user's GitHub (Personal Access Token) account. Each user connects their own GitHub (Personal Access Token) access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 217 tools.

Tools
217
What they doRead · write · destructive
106 · 76 · 35106 read76 write35 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the GitHub (Personal Access Token) connection

    In AgentKit > Connections, create a GitHub (Personal Access Token) connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'githubpat'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize GitHub (Personal Access Token):', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'githubpat_gists_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their GitHub credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • githubpat_artifact_getGet a single workflow run artifact's metadata by its ID.Read-only

    Get Artifact

    Get a single workflow run artifact's metadata by its ID.

    Inputs

    artifact_idnumberrequired
    The unique identifier of the artifact
    ownerstringrequired
    The account owner of the repository
    repostringrequired
    The name of the repository
  • githubpat_artifacts_listList artifacts produced by workflow runs in a repository.Read-only

    List Repository Artifacts

    List artifacts produced by workflow runs in a repository.

    Inputs

    ownerstringrequired
    The account owner of the repository
    repostringrequired
    The name of the repository
    namestring
    Filter artifacts by exact match on their name
    pagenumber
    Page number of the results to fetch
    per_pagenumber
    The number of results per page (max 100)
  • githubpat_branch_getGet details of a specific branch in a GitHub repository.Read-only

    Get Branch

    Get details of a specific branch in a GitHub repository. Returns the branch name, latest commit SHA, and protection status.

    Inputs

    branchstringrequired
    The name of the branch to retrieve
    ownerstringrequired
    The account owner of the repository
    repostringrequired
    The name of the repository
  • githubpat_branch_protection_getGet the branch protection settings currently configured for a branch.Read-only

    Get Branch Protection

    Get the branch protection settings currently configured for a branch.

    Inputs

    branchstringrequired
    The name of the branch
    ownerstringrequired
    The account owner of the repository
    repostringrequired
    The name of the repository
  • githubpat_branches_listList all branches in a GitHub repository.Read-only

    List Branches

    List all branches in a GitHub repository. Returns branch names, commit SHAs, and protection status. Supports pagination.

    Inputs

    ownerstringrequired
    The account owner of the repository
    repostringrequired
    The name of the repository
    pageinteger
    Page number of results to return (default 1)
    per_pageinteger
    Number of results per page (max 100, default 30)
    protectedboolean
    Filter to only protected branches
  • githubpat_check_run_getGet a single check run using its id.Read-only

    Get Check Run

    Get a single check run using its id. OAuth app tokens and personal access tokens (classic) need the repo scope for private repositories.

    Inputs

    check_run_idnumberrequired
    The unique identifier of the check run
    ownerstringrequired
    The account owner of the repository
    repostringrequired
    The name of the repository
  • githubpat_check_runs_list_for_refList check runs for a commit ref.Read-only

    List Check Runs for a Git Reference

    List check runs for a commit ref. The ref can be a SHA, branch name, or tag name.

    Inputs

    ownerstringrequired
    The account owner of the repository
    refstringrequired
    The commit reference. Can be a commit SHA, branch name (heads/BRANCH_NAME), or tag name (tags/TAG_NAME)
    repostringrequired
    The name of the repository
    check_namestring
    Returns check runs with the specified name
    pagenumber
    Page number of results to fetch
    per_pagenumber
    Number of results per page (max 100)
    statusstring
    Returns check runs with the specified statusone of queuedin_progresscompleted
  • githubpat_code_scanning_alerts_listList code scanning alerts for a repository.Read-only

    List Code Scanning Alerts for a Repository

    List code scanning alerts for a repository. To use this endpoint, you must have read access to the repository, and for private/internal repositories your token needs the security_events scope (public_repo is sufficient for public repositories).

    Inputs

    ownerstringrequired
    The account owner of the repository
    repostringrequired
    The name of the repository
    afterstring
    A cursor, as given in the Link response header. Only search for results after this cursor.
    assigneesstring
    Comma-separated list of user handles to filter by, or '*' for alerts with at least one assignee, or 'none' for unassigned alerts
    beforestring
    A cursor, as given in the Link response header. Only search for results before this cursor.
    directionstring
    The direction to sort the results byone of ascdesc
    pagenumber
    Page number of results to fetch
    per_pagenumber
    Number of results per page (max 100)
    prnumber
    Only list alerts for this pull request number
    refstring
    The Git reference for the results, e.g. refs/heads/main or simply main. Use refs/pull/<number>/merge for a pull request.
    severitystring
    Only list alerts with this severityone of criticalhighmediumlowwarningnoteerror
    sortstring
    The property by which to sort the resultsone of createdupdated
    statestring
    Only list alerts with this stateone of opencloseddismissedfixed
    tool_guidstring
    Only list alerts from the code scanning tool with this GUID. Cannot be used together with tool_name.
    tool_namestring
    Only list alerts from this code scanning tool. Cannot be used together with tool_guid.