Skip to main content

GitHub Connector

Connect to GitHub to index code repositories, documentation, and issues from your organization or personal account.

Overview

The GitHub connector allows you to:

  • Index repository code and documentation
  • Search across branches and tags
  • Filter by path and file type
  • Support GitHub Enterprise

Prerequisites

  • GitHub account or organization membership
  • Repository access (read permissions)
  • Personal Access Token or OAuth app authorization

Authentication

  1. Click Connect with GitHub
  2. Authorize ZenSearch to access your repositories
  3. Select organization access if needed

Personal Access Token (PAT)

  1. Go to GitHub → Settings → Developer settings → Personal access tokens
  2. Generate a new token with repo scope (or public_repo for public only)
  3. Copy the token and enter it in ZenSearch

Configuration

SettingDescription
Organization/UserGitHub org or username
RepositoriesSpecific repos or all
BranchBranch to index (default: main)
Path FilterLimit to specific paths

Setup Steps

  1. Add Connector: Knowledge → Add Data Source → GitHub
  2. Authenticate: OAuth or enter PAT
  3. Select Repositories: Choose repos to index
  4. Configure Filters: Set branch and path filters
  5. Test & Create: Verify connection and save

Supported Content

Content TypeIndexed
Code filesYes
Markdown docsYes
README filesYes
IssuesYes
Pull requestsYes
Wiki pagesYes

Path Filtering

Include specific paths:

/docs/*
/src/**/*.md
/README.md

Exclude paths:

/node_modules/*
/dist/*
/.git/*

Real-time Sync

GitHub webhooks provide instant updates:

  • New commits trigger re-indexing
  • Issue updates sync immediately
  • Branch changes are tracked

Best Practices

  1. Filter out node_modules, vendor, and build directories
  2. Focus on documentation and source code
  3. Use branch filtering for stable content
  4. Enable webhook for real-time updates

Troubleshooting

Access denied: Verify PAT has repo scope or OAuth is authorized

Missing repos: Check organization membership and repo visibility

Webhook errors: Verify webhook URL is accessible from GitHub