metadata-ingestion/docs/sources/github/github-documents_post.md
source:
type: github-documents
config:
github_token: "${GITHUB_TOKEN}"
repository: acme/handbook
branch: main
path_prefix: docs
parent_document_urn: "urn:li:document:context-handbook"
document_import_mode: NATIVE
show_in_global_context: true
stateful_ingestion:
enabled: true
sink:
type: datahub-rest
config:
server: "http://localhost:8080"
source:
type: github-documents
config:
github_token: "${GITHUB_TOKEN}"
repository: https://github.com/acme/handbook
document_import_mode: EXTERNAL
stateful_ingestion:
enabled: true
sink:
type: datahub-rest
config:
server: "http://localhost:8080"
GitHub files are imported as plain markdown or text. Document metadata (title, tags, ownership, etc.) lives in DataHub aspects and customProperties — not in YAML frontmatter or other file headers.
Each imported file document stores these customProperties keys:
| Key | Purpose |
|---|---|
import_source_id | Stable external key for upserts |
content_hash | SHA-256 of raw file body (change detection) |
extraction_algo_version | Bump when hash algorithm changes |
github_blob_sha | Git blob SHA at last import |
github_commit_sha | Branch HEAD at last import |
Cloud sync-back may additionally write last_exported_content_hash to prevent re-import loops after export.
Enable stateful_ingestion.enabled: true (recommended for scheduled syncs) to soft-delete documents that disappear from the GitHub tree between runs. Unchanged file bodies are skipped when a graph connection is available and the stored content_hash matches.
api.github.com.path_prefix or split across sources.max_files (default 500) per run.path_prefix and file_extensions filters.stateful_ingestion.enabled: true and the pipeline has a graph connection for checkpoint storage.github-tree-truncated or github-files-truncated.