Skip to main content

GitHub Integration

Automatically sync code, documentation, and README files from your GitHub repositories.

What Gets Synced

Content TypeSyncedNotes
Markdown filesYes.md, .mdx
Code filesYes.py, .js, .ts, .go, etc.
README filesYesAll README variants
DocumentationYes/docs folder by default
WikiOptionalRequires separate connection

Quick Setup

1. Connect GitHub

  1. Go to DashboardIntegrationsGitHub
  2. Click Connect GitHub
  3. Authorize Inherent in GitHub
  4. Select repositories to sync

2. Configure Sync

Choose what to sync:

{
"repositories": ["owner/repo1", "owner/repo2"],
"include_patterns": [
"docs/**/*.md",
"README.md",
"src/**/*.py"
],
"exclude_patterns": [
"node_modules/**",
"*.test.js",
".github/**"
],
"branches": ["main", "docs"]
}

3. Initial Sync

Click Start Sync to begin the initial import. This may take a few minutes depending on repository size.

Sync via API

Connect a repository programmatically:

curl -X POST https://api.inherent.systems/v1/integrations/github \
-H "Authorization: Bearer $INHERENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"installation_id": "12345678",
"repositories": ["owner/repo"],
"config": {
"include_patterns": ["docs/**/*.md"],
"branches": ["main"]
}
}'

Webhook Events

Inherent listens for these GitHub events:

EventAction
pushRe-sync changed files
create (branch)Sync new branch if configured
delete (branch)Remove branch content
repositoryHandle repo rename/delete

File Processing

Code Files

Code is chunked by:

  • Functions/methods
  • Classes
  • Logical blocks

Each chunk includes:

  • File path
  • Line numbers
  • Language metadata

Documentation

Markdown is chunked by:

  • Headings
  • Sections
  • Paragraphs (for long sections)

Permissions Required

PermissionWhy
Contents: ReadRead repository files
Metadata: ReadAccess repo metadata
Webhooks: Read/WriteReceive change notifications

Troubleshooting

Sync Not Working

  1. Check webhook delivery in GitHub (Settings → Webhooks)
  2. Verify file matches include patterns
  3. Check file size (max 1MB per file)

Missing Files

  1. Verify file type is supported
  2. Check exclude patterns
  3. Confirm branch is configured for sync

Rate Limits

GitHub API has rate limits. Inherent handles this automatically, but large initial syncs may be throttled.

Example: Sync Documentation Site

{
"repositories": ["mycompany/docs"],
"config": {
"include_patterns": [
"docs/**/*.md",
"docs/**/*.mdx",
"blog/**/*.md"
],
"exclude_patterns": [
"docs/drafts/**"
],
"branches": ["main"],
"chunking": {
"strategy": "headings"
}
}
}