GitHub Integration
Automatically sync code, documentation, and README files from your GitHub repositories.
What Gets Synced
| Content Type | Synced | Notes |
|---|---|---|
| Markdown files | Yes | .md, .mdx |
| Code files | Yes | .py, .js, .ts, .go, etc. |
| README files | Yes | All README variants |
| Documentation | Yes | /docs folder by default |
| Wiki | Optional | Requires separate connection |
Quick Setup
1. Connect GitHub
- Go to Dashboard → Integrations → GitHub
- Click Connect GitHub
- Authorize Inherent in GitHub
- 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:
| Event | Action |
|---|---|
push | Re-sync changed files |
create (branch) | Sync new branch if configured |
delete (branch) | Remove branch content |
repository | Handle 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
| Permission | Why |
|---|---|
Contents: Read | Read repository files |
Metadata: Read | Access repo metadata |
Webhooks: Read/Write | Receive change notifications |
Troubleshooting
Sync Not Working
- Check webhook delivery in GitHub (Settings → Webhooks)
- Verify file matches include patterns
- Check file size (max 1MB per file)
Missing Files
- Verify file type is supported
- Check exclude patterns
- 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"
}
}
}