Documentation Ingestion Runbook
Review Dates
- Last reviewed: 2026-04-24
Purpose
This runbook defines a reusable ingestion process for any repository that pulls documentation from external sources and publishes normalized content into the portal/site repository.
Where To Update This Template
Update this file in:
docs/runbooks/ingestion-runbook.md
Add or modify repository-specific values under the section Repository-Specific Values To Fill.
Repository-Specific Values To Fill
Replace placeholders below for your target repository:
<ORG>/<REPO>: GitHub repository slug<DEFAULT_BRANCH>: default branch (usuallymain)<INGEST_WORKFLOW_PATH>: path to workflow file (for example.github/workflows/ingest.yml)<INGEST_SCRIPT_PATH>: path to ingestion script (for examplescripts/ingest.mjs)<SOURCES_CONFIG_PATH>: source configuration file (for examplesources.json)<CONTENT_OUTPUT_DIR>: output folder (for examplecontent/docs)<PUBLIC_ASSET_DIR>: public assets folder (for examplepublic/docs)<NODE_VERSION_VAR>: Actions variable used by workflow (for exampleNODE_VERSION)<DISPATCH_EVENT_TYPE>: repository dispatch type (for exampledocs-update)<SOURCE_INPUT_NAME>: manual workflow input name (for examplesource)
Absolute links pattern:
- Repository:
https://github.com/<ORG>/<REPO> - Workflow:
https://github.com/<ORG>/<REPO>/blob/<DEFAULT_BRANCH>/<INGEST_WORKFLOW_PATH> - Script:
https://github.com/<ORG>/<REPO>/blob/<DEFAULT_BRANCH>/<INGEST_SCRIPT_PATH> - Sources config:
https://github.com/<ORG>/<REPO>/blob/<DEFAULT_BRANCH>/<SOURCES_CONFIG_PATH> - Output directory:
https://github.com/<ORG>/<REPO>/tree/<DEFAULT_BRANCH>/<CONTENT_OUTPUT_DIR>
Canonical Links
- Repository:
https://github.com/<ORG>/<REPO> - Ingestion workflow:
https://github.com/<ORG>/<REPO>/blob/<DEFAULT_BRANCH>/<INGEST_WORKFLOW_PATH> - Ingestion script:
https://github.com/<ORG>/<REPO>/blob/<DEFAULT_BRANCH>/<INGEST_SCRIPT_PATH> - Sources config:
https://github.com/<ORG>/<REPO>/blob/<DEFAULT_BRANCH>/<SOURCES_CONFIG_PATH> - Output directory:
https://github.com/<ORG>/<REPO>/tree/<DEFAULT_BRANCH>/<CONTENT_OUTPUT_DIR>
What Ingestion Should Do
- Read enabled source definitions from source config.
- Clone/pull source repositories into a cache directory.
- Convert source docs into normalized markdown/content format.
- Write converted docs to
<CONTENT_OUTPUT_DIR>/<source-id>. - Copy referenced assets to both content and public asset directories.
- Write metadata file per source (for example
_meta.json).
Source Configuration Contract
Define each source under a list (for example sources[]) with fields like:
id: output folder namerepo: source repo slug (owner/repo)branch: source branchdocsPath: docs root path in source repoformat: converter type (tech-docs-template,markdown, etc.)enabled: include/exclude sourceowner_slackor equivalent owner metadata (optional)
How To Add A New Source
- Add a new object under
sources[]in<SOURCES_CONFIG_PATH>with at least:
id(kebab-case, unique)namerepo(owner/repo)branchdocsPathformat(tech-docs-templateormarkdown)enabled(true)
- Validate source path and format assumptions in the source repo:
docsPathexists on the target branch- files under
docsPathmatch expected format (.md,.mdx, or.html.md.erbfor tech-docs-template)
- Run a dry run for the new source only:
node <INGEST_SCRIPT_PATH> <new-source-id> --dry-run
- Run a real ingestion for the new source only:
node <INGEST_SCRIPT_PATH> <new-source-id>
- Validate generated output:
<CONTENT_OUTPUT_DIR>/<new-source-id>/exists- metadata file exists (for example
_meta.json) - referenced assets are copied as expected
- Run build validation:
npm run build
Commit the source config and generated content changes in one PR.
Optionally trigger workflow dispatch with
<SOURCE_INPUT_NAME>=<new-source-id>to validate CI ingestion path.
Running Ingestion
Local
# Ingest all enabled sources
node <INGEST_SCRIPT_PATH>
# Ingest a single source
node <INGEST_SCRIPT_PATH> <source-id>
# Dry run
node <INGEST_SCRIPT_PATH> --dry-run
Package Scripts (Optional)
npm run ingest
npm run ingest:dry-run
npm run ingest:build
GitHub Actions Trigger Model
Recommended trigger modes:
workflow_dispatchfor manual runsschedulefor periodic syncrepository_dispatchfor source-driven updates
Manual run URL pattern:
https://github.com/<ORG>/<REPO>/actions/workflows/<INGEST_WORKFLOW_FILE_NAME>
Manual Input
Optional input example:
<SOURCE_INPUT_NAME>: source ID (empty means all)
Repository Dispatch Payload
If workflow expects client_payload.source_id:
{
"event_type": "<DISPATCH_EVENT_TYPE>",
"client_payload": {
"source_id": "<source-id>"
}
}
Workflow Runtime Requirements
- Node version variable configured (for example
vars.<NODE_VERSION_VAR>) - Workflow permissions to commit content changes (
contents: write) when auto-commit is enabled - Network access from runner to source repositories
Commit Strategy
Typical post-ingestion behavior:
git add -A- Exit success if no changes
- Commit and push if changes exist
Suggested commit message:
chore(ingest): refresh external documentation
Validation Checklist
After each ingestion run:
- Confirm Actions run success.
- Verify changed files under
<CONTENT_OUTPUT_DIR>and<PUBLIC_ASSET_DIR>. - Verify metadata file exists for each ingested source.
- Run build locally:
npm run build
- Spot-check representative pages for each source.
Troubleshooting Guide
No matching sources
Cause:
- Invalid source ID or all sources disabled.
Resolution:
- Validate source ID exists in config.
- Ensure target source has
enabled: true.
Docs path not found
Cause:
- Source docs path changed in upstream repo.
Resolution:
- Update
docsPathin source config. - Re-run ingestion for the affected source.
Clone/pull failures
Cause:
- Invalid repo/branch or temporary network failure.
Resolution:
- Validate
repoandbranchvalues. - Retry workflow run.
Build fails after ingestion
Cause:
- Converted markdown/content incompatible with local renderer/build.
Resolution:
- Run build locally and inspect failure path.
- Update conversion logic in ingestion script.
Useful Operational Commands
# Show staged/unstaged ingestion output
git status --short <CONTENT_OUTPUT_DIR> <PUBLIC_ASSET_DIR>
# List source output directories
ls -1 <CONTENT_OUTPUT_DIR>
# Check metadata files
find <CONTENT_OUTPUT_DIR> -name "_meta.json"
# Check unresolved ERB markers after conversion
rg "<[%]|%>" <CONTENT_OUTPUT_DIR>
Rollback
If ingestion introduces bad content:
- Revert ingestion commit(s).
- Re-run build checks.
- Re-run ingestion only for corrected source after config/script fix.