Clearly AIDocs

GitHub

Connect Clearly AI to GitHub.

Overview

Connect GitHub so Clearly AI can use your repositories as project context and review the code in them.

An admin sets up the GitHub integration once for the workspace with one of two authentication methods:

  • Shared API Token: a GitHub fine-grained personal access token.
  • OAuth 2.0: signing in to GitHub, plus the Clearly AI GitHub App.

For help choosing between them, see Which method should you use?.

Set up GitHub

Prerequisites

  • Access to Integrations in Organization settings
  • A GitHub account that can access the repositories you want Clearly AI to review. For the workspace connection, a bot or service account keeps the connection from depending on one employee's account.

Open the GitHub integration

In Clearly AI, open Organization settings, select Integrations, then click Set up on the GitHub card.

Choose an authentication method

Under Authentication, select Shared API Token or OAuth 2.0.

Option A. Shared API Token

  1. In GitHub, create a fine-grained personal access token. Select the organization and repositories Clearly AI should access, and grant Contents and Pull requests read and write. GitHub adds Metadata read automatically.
  2. Paste the token into Shared API Token.

Option B. OAuth 2.0

Only the owner of the GitHub account, or an owner of the GitHub organization, can install the Clearly AI GitHub App on its repositories.

  1. Check I understand under the shared-credential notice, then click Connect. Connect stays disabled until you check it. Sign in to GitHub if prompted, and approve Clearly AI's access request.
  2. Install the Clearly AI GitHub App on the organization or account that owns the repositories, and grant it access to those repositories.

Clearly AI shows a green Connected label as soon as you sign in to GitHub, before it has found a Clearly AI GitHub App installation. Connected doesn't mean repository access works. Install the App before you add the credential.

Add the credential

Check I understand under the shared-credential notice if you haven't already, then click Add workspace credential. Clearly AI tests the credential and enables the integration only when the test passes. Projects can then add GitHub repositories as sources.

To change the token or the GitHub account later, click Configure on the GitHub card, open the Connections tab, click Edit authentication, then click Apply and test.

People can also connect their own GitHub account as a Personal (User) Connection: open Customize, go to the Yours tab, and click Connect on GitHub. GitHub appears there only after an admin installs its Connector. Sources that run as you use your Personal Connection. Workflow steps use the Connection selected on the step. A Personal Connection reaches only repositories where the Clearly AI GitHub App is installed, so install the App there first.

Which method should you use?

MethodBest whenNotes
Shared API TokenYou want the quickest setup and prefer to manage the token yourselfAccess is limited to the repositories and permissions granted to that token
OAuth 2.0You want GitHub to handle signing in and grant repository access through the Clearly AI GitHub AppRequires the App installed on the repositories

GitHub App and GitHub user permissions

OAuth 2.0 combines two separate pieces of GitHub access. Both are required, and each does a different job:

PieceGrantsConfigured by
Clearly AI GitHub App installWhich organizations, accounts, and repositories Clearly AI can read (for example, repository contents)The personal account owner, or a GitHub organization owner for org-owned repositories, from the Clearly AI GitHub App install page
GitHub user who signs in with ConnectWhich of those App installations Clearly AI can see and useThe person who signs in through OAuth in Clearly AI

Neither piece alone is enough:

  • The App install without a connected GitHub user leaves Clearly AI with no signed-in identity to look up the installation.
  • A connected GitHub user without the App install leaves Clearly AI with no repository permissions. GitHub App permissions come from the App's install configuration, not from OAuth consent scopes, so signing in doesn't grant repository access by itself.

For a Shared (Workspace) connection, use a dedicated GitHub bot or service account to sign in, instead of a personal account. This keeps the connection working if the employee who set it up changes teams or leaves.

Which GitHub account writes a wiki page

The Upsert GitHub Wiki Page workflow step publishes a review to a GitHub wiki. GitHub stores wiki pages in a separate repository, so the step clones that repository and pushes the page using the GitHub account behind its selected Connection.

The selected GitHub account must have write access to the wiki repository, and the Clearly AI GitHub App must be installed there. The App installation gives Clearly AI access to the repository; it does not grant the selected account write permission. To publish with another account, select a different Connection on the step.

Refresh a repository on a project

Clearly AI keeps the commit it downloaded until you refresh the source. To pick up later commits, open the project, open Manage Sources, and choose Refresh source on the branch. When processing finishes, re-run the review. See Update a review when sources change.

FAQs

  • Integrations - Choose an authentication method for an integration
  • Concepts - Learn how integrations provide project context in Clearly AI