GitHub Files indexes the documentation in a repository: Markdown, MDX, reStructuredText and text files, plus README, CHANGELOG, CONTRIBUTING and LICENSE. You name the repository. Kelu picks the files by convention.
To index source code, use GitHub Code. For issues, pull requests or discussions, use GitHub Issues, GitHub Pull Requests or GitHub Discussions. You can add all of them for one repository.

Before you start

  • The repository’s owner and name.
  • For a private repository, an access token that can read its contents.
  • A Pro plan or above.

Set up

1

Add the source

Open the knowledge base, click Add source and pick GitHub Files. Enter a Display name, then the Owner and Repository name. Pasting the repository’s URL into Owner fills both. Click Test connection, then Add source. The first sync starts right away.
2

Copy the webhook secret

The confirmation screen shows a webhook secret. Copy it now. It is shown only once.
3

Connect the push webhook (optional)

Follow Sync on every push. Without it, the repository is re-read every hour.

Options

FieldRequiredWhat it does
OwnerYesThe user or organization that owns the repository.
Repository nameYesThe repository’s name.
BranchNoEmpty follows the repository’s default branch, whatever it is called.
Access tokenNoNeeded for private repositories.
API URLNoGitHub Enterprise only, for example https://github.example.com/api/v3.
Include pathsNoComma-separated path prefixes or file names, such as docs/, README.md. Only matching files are indexed. Case-sensitive.

What gets indexed

  • Files ending in .md, .mdx, .rst or .txt, anywhere in the repository.
  • Files with no extension whose name starts with README, CHANGELOG, CONTRIBUTING or LICENSE.
  • Skipped: anything under node_modules, vendor, dist, build, target or .git, and any file over 1 MB.
Each file becomes one document. Its title is the file’s first heading, or else its file name. Citations link to the file on GitHub. The source’s Sync history tab shows how many files each rule skipped, with example paths.

Sync on every push

In the repository, open Settings → Webhooks → Add webhook and fill in:
  • Payload URL: copy the Webhook URL from the source’s Webhook tab.
  • Secret: the webhook secret you copied when you added the source.
  • Events: just the push event.
Each push starts a sync. Lost the secret? Delete the source and add it again to get a new one.

Sync

The repository is re-read every hour, with or without a webhook. Files that have not changed are not re-embedded. Click Sync Now on the source page to sync at once. See Keeping content fresh.

Versioned docs from branches

Add one source per branch, and give each a Version label when you add it. Then use source groups to point each widget or API caller at one version.

Troubleshooting

  • Files are missing. Check the rules above and your Include paths. The Sync history tab says how many files each rule skipped.
  • Nothing is indexed but the sync succeeded. An Include paths prefix matches nothing. Prefixes are case-sensitive.
  • http status 404 fetching archive. The owner or name is wrong, the Branch doesn’t exist, or the token can’t read the private repository. Test connection shows the same error before you save.
  • GitHub shows deliveries answered invalid signature. The secret in GitHub doesn’t match. Check for extra spaces, or re-add the source.
  • GitHub shows deliveries answered ignored. The webhook sends events other than push. Only push events start a sync.