Create GitHub Repository Feed
User Intent
"How do I sync files from a GitHub repository? Show me GitHub repo feed configuration."
Operation
SDK Method: createFeed() with FeedTypes.Site
Auth: GitHub personal access token or OAuth
Code Example (TypeScript)
import { Graphlit } from 'graphlit-client';
import { FeedTypes, FeedServiceTypes } from 'graphlit-client/dist/generated/graphql-types';
const graphlit = new Graphlit();
const feed = await graphlit.createFeed({
name: 'GraphQL Docs',
type: FeedTypes.Site,
site: {
type: FeedServiceTypes.GitHub,
github: {
repositoryOwner: 'graphql',
repositoryName: 'graphql-spec',
personalAccessToken: process.env.GITHUB_TOKEN!,
},
allowedPaths: ['spec/**', 'README.md'],
readLimit: 1000,
},
// Optional: add workflow for content processing
// workflow: { id: workflow.createWorkflow.id }
});
console.log(`Created GitHub repo feed: ${feed.createFeed.id}`);Configuration
repositoryOwner: GitHub username or organization repositoryName: Repository name personalAccessToken: GitHub PAT allowedPaths: Array of path patterns to include excludedPaths: Array of path patterns to exclude readLimit: Maximum files to sync
Path Filtering
Include specific directories:
Exclude patterns:
File type filtering:
What Gets Synced
Source code files
Documentation files
README and configuration files
File metadata (path, size, modified date)
Git metadata (commit hash, author)
Use Cases
Documentation Sync:
Code Search:
Examples Library:
Private vs Public Repos
Public Repos:
Can use token with
public_reposcopeNo special permissions needed
Private Repos:
Requires token with full
reposcopeMust have repository access
Related
GitHub Issues Feed - Sync issues
GitHub Commits Feed - Sync commits
GitHub Pull Requests Feed - Sync pull requests
Web Crawl - Crawl any website
Last updated
Was this helpful?