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
OAuth 2.0 (Recommended)
- Click Connect with GitHub
- Authorize ZenSearch to access your repositories
- Select organization access if needed
Personal Access Token (PAT)
- Go to GitHub → Settings → Developer settings → Personal access tokens
- Generate a new token with
reposcope (orpublic_repofor public only) - Copy the token and enter it in ZenSearch
Configuration
| Setting | Description |
|---|---|
| Organization/User | GitHub org or username |
| Repositories | Specific repos or all |
| Branch | Branch to index (default: main) |
| Path Filter | Limit to specific paths |
Setup Steps
- Add Connector: Knowledge → Add Data Source → GitHub
- Authenticate: OAuth or enter PAT
- Select Repositories: Choose repos to index
- Configure Filters: Set branch and path filters
- Test & Create: Verify connection and save
Supported Content
| Content Type | Indexed |
|---|---|
| Code files | Yes |
| Markdown docs | Yes |
| README files | Yes |
| Issues | Yes |
| Pull requests | Yes |
| Wiki pages | Yes |
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
- Filter out
node_modules,vendor, and build directories - Focus on documentation and source code
- Use branch filtering for stable content
- 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