> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ruby.ad/llms.txt
> Use this file to discover all available pages before exploring further.

# Github

> [!CAUTION]
>
> **Limitations**
>
> GitHub synchronization is limited to issues, discussions, and top-level pull request comments.\
> In-code comments in pull requests, the actual source code, and other GitHub-specific data, such as commit history, are not synchronized unless you enable it.
> Files larger than 4MiB are ignored.

## Overview

Ruby integrates with Github to bring your repository's Issues, Pull Requests, Discussions, and (if enabled) codebase into Ruby, so agents can search and use that content.
Only Github Admins can set up this connection due to permission restrictions.

## Setting up the Connection

### Initial Connection Setup

1. **Access Control**: Ensure you're a Ruby Admin and have the necessary permissions on GitHub to establish connections.
2. **Navigate to Ruby**: Go to `Spaces` > `Connections` > Select `GitHub` > Connect.
3. **Authenticate**: Click `Configure` and authenticate your GitHub account to grant Ruby permission to access your GitHub data.

Github redirect to install and configure Ruby.

Github redirect to install and configure Ruby.

1. **Select your repos:** Give access to the repo you select from `Repository access`.

Github redirect: select all repos.

Github redirect: select granular repos you want to sync with your Ruby workspace.

1. **Enable Code sync:** Optionally give access to your codebase by toggling `Code synchronization`.

Ruby modal to enable code synchronization.

> [!CAUTION]
>
> **Permissions**
>
> Ensure the GitHub account used for the connection has ongoing access to the selected repositories. Changing permissions in GitHub may impact Ruby’s ability to synchronize new data.
> The Github app will be created with the following permissions
> Repository content : **ReadOnly**\
> Issues : **ReadOnly**\
> Discussions : **ReadOnly**\
> Pages : **ReadOnly**\
> Projects : **ReadOnly**\
> Pull Requests : **ReadOnly**\
> All the rest : **No Access**

## Updating the Connection and Managing Permissions

To modify permissions and which repositories or types of data are synchronized:

1. Go to `Spaces` > `Connections`.
2. Click `Manage` next to GitHub.
3. Click Add/Remove Data, Manage permissions, re-auth, and follow the steps above.
4. Adjust your selections for repositories, then save your changes.

> [!WARNING]
>
> Do not uninstall the Ruby GitHub App from GitHub directly. Ruby is not notified when the app is removed, so the connection still looks configured but stops syncing, and reinstalling the app can't reconnect it. To change which repositories Ruby can access, follow the steps above. To remove the connection, use your Ruby support channel.
>
> If the app was already uninstalled, use your Ruby support channel to remove the old connection. Then create a new GitHub connection, select your repositories again, and update the agents that used the old connection so they use the new one.

## Data Synchronization

* **Issues**: Titles, descriptions, comments, and tags.
* **Discussions**: Discussion titles, initial posts, and comments.
* **Pull Requests**: Titles, descriptions, and top-level comments (in-code comments not included).
* **Code Synchronization:** Repository code from the default branch

## Refresh and Sync Details

* **Refresh Rate**: Issues, Discussions and Pull-requests are maintained up to date in real-time. Code is synchronized every 8 hours.

Ruby syncs the custom labels set on GitHub issues and Pull Requests, and include them in the document above the content itself.

It also automatically adds those labels:

`title:Title of the issue/pull request`,

`isPullRequest:true|false`,

`author:@githubHandle`.

**Labels**  allow for additional filtering on data sources selected on the [semantic search](https://docs.ruby.ad/docs/user-documentation/agents/knowledge/search-data-sources.md) tool.

> [!NOTE]
>
> **Labels support was added Feb 11 2025**
>
> Issues and Pull Requests older than that won't have those labels ingested.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.