Integrations
Prebuilt Toolkits
Github
GitHub

GitHub

Description: Enable agents to interact with GitHub repositories, issues, and pull requests.

Author: Arcade AI

Code: GitHub

Auth: User authorization via the GitHub auth provider

PyPI VersionLicensePython VersionsWheel StatusDownloads

The Arcade AI GitHub toolkit provides a pre-built set of tools for interacting with GitHub. These tools make it easy to build agents and AI apps that can:

  • Access private repositories (with the user's permission)
  • Get info about repositories, issues, pull requests, and more
  • Post issues, comments, and replies as the user

Install

pip install arcade_github

Available Tools

Tool NameDescription
SetStarredStar or unstar a GitHub repository.
CreateIssueCreate an issue in a GitHub repository.
CreateIssueCommentCreate a comment on an issue in a GitHub repository.
ListPullRequestsList pull requests in a GitHub repository.
GetPullRequestGet details of a pull request in a GitHub repository.
UpdatePullRequestUpdate a pull request in a GitHub repository.
ListPullRequestCommitsList commits on a pull request in a GitHub repository.
CreateReplyForReviewCommentCreate a reply to a review comment on a pull request.
ListReviewCommentsOnPullRequestList review comments on a pull request.
CreateReviewCommentCreate a review comment on a pull request.
CountStargazersCount the number of stargazers for a GitHub repository.
ListOrgRepositoriesList repositories of a GitHub organization.
GetRepositoryGet details of a GitHub repository.
ListRepositoryActivitiesList activities of a GitHub repository.
ListReviewCommentsInARepositoryList review comments in a repository.

If you need to perform an action that's not listed here, you can get in touch with us to request a new tool, or create your own tools with the GitHub auth provider.

SetStarred


Star or unstar a GitHub repository.

Parameters

  • owner (string, required) The owner of the repository.
  • name (string, required) The name of the repository.
  • starred (boolean, required) Whether to star (true) or unstar (false) the repository.

CreateIssue


Create an issue in a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • title (string, required) The title of the issue.
  • body (string, optional) The contents of the issue.
  • assignees (array of strings, optional) Logins for Users to assign to this issue.
  • milestone (integer, optional) The number of the milestone to associate this issue with.
  • labels (array of strings, optional) Labels to associate with this issue.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the issue. This is a large payload and may impact performance - use with caution.

CreateIssueComment


Create a comment on an issue in a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • issue_number (integer, required) The number that identifies the issue.
  • body (string, required) The contents of the comment.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the comment. This is a large payload and may impact performance - use with caution.

ListPullRequests


List pull requests in a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • state (enum (PRState), optional, Defaults to PRState.OPEN) The state of the pull requests to return.
  • head (string, optional) Filter pulls by head user or head organization and branch name in the format of user:ref-name or organization:ref-name.
  • base (string, optional, Defaults to 'main') Filter pulls by base branch name.
  • sort (enum (PRSortProperty), optional, Defaults to PRSortProperty.CREATED) The property to sort the results by.
  • direction (enum (SortDirection), optional) The direction of the sort.
  • per_page (integer, optional, Defaults to 30) The number of results per page (max 100).
  • page (integer, optional, Defaults to 1) The page number of the results to fetch.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the pull requests. This is a large payload and may impact performance - use with caution.

GetPullRequest


Get details of a pull request in a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • pull_number (integer, required) The number that identifies the pull request.
  • include_diff_content (boolean, optional, Defaults to false) If true, return the diff content of the pull request.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the pull requests. This is a large payload and may impact performance - use with caution.

UpdatePullRequest


Update a pull request in a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • pull_number (integer, required) The number that identifies the pull request.
  • title (string, optional) The title of the pull request.
  • body (string, optional) The contents of the pull request.
  • state (enum (PRState), optional) State of this Pull Request. Either open or closed.
  • base (string, optional) The name of the branch you want your changes pulled into.
  • maintainer_can_modify (boolean, optional) Indicates whether maintainers can modify the pull request.

ListPullRequestCommits


List commits (from oldest to newest) on a pull request in a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • pull_number (integer, required) The number that identifies the pull request.
  • per_page (integer, optional, Defaults to 30) The number of results per page (max 100).
  • page (integer, optional, Defaults to 1) The page number of the results to fetch.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the pull requests. This is a large payload and may impact performance - use with caution.

CreateReplyForReviewComment


Create a reply to a review comment for a pull request in a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • pull_number (integer, required) The number that identifies the pull request.
  • comment_id (integer, required) The unique identifier of the comment to reply to.
  • body (string, required) The text of the reply comment.

ListReviewCommentsOnPullRequest


List review comments on a pull request in a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • pull_number (integer, required) The number that identifies the pull request.
  • sort (enum (ReviewCommentSortProperty), optional, Defaults to 'created') The property to sort the results by. Can be one of: created, updated.
  • direction (enum (SortDirection), optional, Defaults to 'desc') The direction to sort results. Can be one of: asc, desc.
  • since (string, optional) Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • per_page (integer, optional, Defaults to 30) The number of results per page (max 100).
  • page (integer, optional, Defaults to 1) The page number of the results to fetch.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the pull requests. This is a large payload and may impact performance - use with caution.

CreateReviewComment


Create a review comment for a pull request in a GitHub repository.

If the subject_type is not 'file', then the start_line and end_line parameters are required. If the subject_type is 'file', then the start_line and end_line parameters are ignored. If the commit_id is not provided, the latest commit SHA of the PR's base branch will be used.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • pull_number (integer, required) The number that identifies the pull request.
  • body (string, required) The text of the review comment.
  • path (string, required) The relative path to the file that necessitates a comment.
  • commit_id (string, optional) The SHA of the commit needing a comment. If not provided, the latest commit SHA of the PR's base branch will be used.
  • start_line (integer, optional) The start line of the range of lines in the pull request diff that the comment applies to. Required unless 'subject_type' is 'file'.
  • end_line (integer, optional) The end line of the range of lines in the pull request diff that the comment applies to. Required unless 'subject_type' is 'file'.
  • side (enum (DiffSide), optional, Defaults to 'RIGHT') The side of the diff that the pull request's changes appear on. Use LEFT for deletions that appear in red. Use RIGHT for additions that appear in green or unchanged lines that appear in white and are shown for context.
  • start_side (string, optional) The starting side of the diff that the comment applies to.
  • subject_type (enum (ReviewCommentSubjectType), optional, Defaults to 'FILE') The type of subject that the comment applies to. Can be one of: file, hunk, or line.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the review comment. This is a large payload and may impact performance - use with caution.

CountStargazers


Count the number of stargazers (stars) for a GitHub repository.

Parameters

  • owner (string, required) The owner of the repository.
  • name (string, required) The name of the repository.

ListOrgRepositories


List repositories for the specified GitHub organization.

Parameters

  • org (string, required) The organization name. The name is not case sensitive.
  • repo_type (enum (RepoType), optional, Defaults to 'ALL') The types of repositories to return.
  • sort (enum (RepoSortProperty), optional, Defaults to 'CREATED') The property to sort the results by.
  • sort_direction (enum (SortDirection), optional, Defaults to 'ASC') The order to sort by.
  • per_page (integer, optional, Defaults to 30) The number of results per page.
  • page (integer, optional, Defaults to 1) The page number of the results to fetch.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the repositories. This is a large payload and may impact performance - use with caution.

GetRepository


Get detailed information about a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the repository. This is a large payload and may impact performance - use with caution.

ListRepositoryActivities


List repository activities such as pushes, merges, force pushes, and branch changes. Retrieves a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes,and associates these changes with commits and users.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • direction (enum (SortDirection), optional, Defaults to 'DESC') The direction to sort the results by.
  • per_page (integer, optional, Defaults to 30) The number of results per page (max 100).
  • before (string, optional) A cursor (unique identifier, e.g., a SHA of a commit) to search for results before this cursor.
  • after (string, optional) A cursor (unique identifier, e.g., a SHA of a commit) to search for results after this cursor.
  • ref (string, optional) The Git reference for the activities you want to list. Can be formatted as refs/heads/BRANCH_NAME or just BRANCH_NAME.
  • actor (string, optional) The GitHub username to filter by the actor who performed the activity.
  • time_period (enum (RepoTimePeriod), optional) The time period to filter by.
  • activity_type (enum (ActivityType), optional) The activity type to filter by.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the activities. This is a large payload and may impact performance - use with caution.

ListReviewCommentsInARepository


List review comments in a GitHub repository.

Parameters

  • owner (string, required) The account owner of the repository. The name is not case sensitive.
  • repo (string, required) The name of the repository without the .git extension. The name is not case sensitive.
  • sort (enum (ReviewCommentSortProperty), optional, Defaults to 'created') The property to sort the results by. Can be one of: created, updated.
  • direction (enum (SortDirection), optional, Defaults to 'DESC') The direction to sort results. Ignored without sort parameter. Can be one of: asc, desc.
  • since (string, optional) Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • per_page (integer, optional, Defaults to 30) The number of results per page (max 100).
  • page (integer, optional, Defaults to 1) The page number of the results to fetch.
  • include_extra_data (boolean, optional, Defaults to false) If true, return all the data available about the pull requests. This is a large payload and may impact performance - use with caution.

Auth

The Arcade AI GitHub toolkit uses the GitHub auth provider to connect to users' GitHub accounts.

With the hosted Arcade AI Engine, there's nothing to configure. Your users will see Arcade AI (demo) as the name of the application that's requesting permission.

The hosted Arcade AI Engine is intended for demo and testing purposes only, not for production use. To use Arcade AI and GitHub in production, you must use a self-hosted instance of the Arcade Engine.

With a self-hosted installation of Arcade AI, you need to configure the GitHub auth provider with your own GitHub app credentials.