{{ currentLang.label }}
Validate knowledge in CI
The pre-commit hook checks what each person commits. A CI job catches everything else: commits made with --no-verify, machines without kontext, and entries whose paths stopped matching after a refactoring.
GitHub Actions
yaml
# .github/workflows/knowledge.yml
name: knowledge
on:
pull_request:
paths: [".ai/**", "docs/adr/**"]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install kontext
run: curl -fsSL https://raw.githubusercontent.com/SemanS/kontext/main/scripts/install.sh | sh
- name: Validate entries and scan for secrets
run: ~/.local/bin/kontext checkkontext check exits with status 1 on errors (missing titles, unknown kinds, duplicate ids, high-confidence secrets) and prints warnings without failing.
Pin a version for reproducible builds:
yaml
run: curl -fsSL https://raw.githubusercontent.com/SemanS/kontext/main/scripts/install.sh | KONTEXT_VERSION=v0.1.1 shOther CI systems
Any runner with git works:
sh
curl -fsSL https://raw.githubusercontent.com/SemanS/kontext/main/scripts/install.sh | sh
~/.local/bin/kontext checkUseful additions
kontext log --jsonproduces a machine-readable decision timeline, e.g. for a docs site.kontext checkalso scans knowledge for secrets; setsecrets.scan = "staged"locally if you want the hook to scan every staged file.