Skip to main content
Table of Contents

Connecting GitHub Cloud to LinearB

Connect your GitHub Cloud organization to LinearB to sync repositories, pull requests, and Git activity.

Steven Silverstone
Updated by Steven Silverstone

This guide explains how to connect GitHub to LinearB. You can connect using OAuth (recommended) or a Personal Access Token (PAT).

OAuth is the preferred method for most users. A PAT may be required if you do not have admin permissions in your GitHub organization.

Supported repository types
LinearB supports private, public, and internal GitHub repositories. You can choose which repositories to sync during setup.

Summary

What this guide covers

  • Connecting GitHub using OAuth (recommended)
  • Connecting GitHub using a Personal Access Token (PAT)
  • Required permissions for Classic and Fine-Grained PATs
  • Webhook alternatives when permissions are restricted
  • Reauthorizing an expired GitHub token

Before you begin

  • LinearB Admin role
  • GitHub organization access
  • Admin permissions (required for OAuth or PAT creation)

Method 1: Connect GitHub using OAuth (recommended)

OAuth is the simplest and most seamless way to connect GitHub to LinearB.

  1. In LinearB, go to Settings → Company Settings and select the Git tab.
  2. Click Add Integration.
  3. Select GitHub.
  4. Click Authorize GitHub.
  5. If you have the required permissions, authorize LinearB to access your GitHub organization. Otherwise, request approval from a GitHub admin.
  6. Select the repositories you want to sync and click Connect GitHub.

Once connected, LinearB begins syncing repository data and enables metrics and automations such as WorkerB.


Method 2: Connect GitHub using a Personal Access Token (PAT)

If OAuth is not possible (for example, due to insufficient permissions), you can connect GitHub using a Personal Access Token (PAT).

Step 1. Create a Personal Access Token in GitHub

  1. Log in to GitHub.
  2. Create either a Fine-grained PAT or a Classic PAT.
  3. Set an expiration date. To avoid data gaps, we recommend choosing a long expiration period or no expiration (if supported).
To create a PAT for LinearB, you must be a GitHub organization owner or have admin permissions.

Required permissions

Classic PAT Fine-grained PAT
  • repo
  • read:org
  • read:user
  • user:email
  • read:discussion
  • admin:repo-hook (read/write)
  • members:read
  • metadata:read
  • pull_requests:read
  • contents:read
  • webhooks:write

If write:repo-hook cannot be granted, see Alternative to write:repo-hook permission below.

  1. Copy the token. You will not be able to view it again.

Step 2. Add the GitHub PAT to LinearB

  1. In LinearB, go to Settings → Company Settings → Git.
  2. Click Add Integration and select GitHub.
  3. Select Classic or Fine-grained token.
  4. Paste the PAT and click Connect.

Alternative to write:repo-hook permission

LinearB uses repository webhooks for real-time data collection. If write:repo-hook cannot be granted, choose one of the following options:

Option 1: Delayed sync

LinearB syncs data every 2 hours instead of in real time. Metrics and notifications may be delayed.

Option 2: Organization-level webhook

Install a GitHub organization-level webhook to bypass repository-level permissions. See Installing a GitHub Organization-Level Webhook .


Reauthorizing an expired GitHub PAT
  1. Create a new PAT in GitHub.
  2. In LinearB, go to Settings → Company Settings → Git.
  3. Open the three-dot menu next to the GitHub integration.
  4. Select Reauthorize Git and paste the new token.

LinearB resumes syncing data using the new token.


Troubleshooting & support

How did we do?

Connecting LinearB to GitHub With Read Only Permissions

Contact