Validate in CI#
Run Katalyst in continuous integration so malformed frontmatter and
non-canonical formatting fail the build instead of reaching main.
Exit codes#
Both gating commands use the same convention:
| Code | Meaning |
|---|---|
0 | Everything passed |
1 | One or more items failed (validation or formatting) |
2 | Usage error (e.g. no .katalyst/ directory found) |
Gate on validation#
katalyst check over the whole project exits non-zero if any item has a
violation:
katalyst checkAn item with a violation, here one missing its H1, prints the diagnostic and the run exits 1, the non-zero status that fails the CI step:
<project>/notes/intro.md: OK
<project>/notes/draft.md: /: missing H1 heading in markdown body
exit status 1
Gate on formatting#
katalyst fix --check writes nothing; it lists items whose frontmatter is
not canonical and exits 1 if any are found:
katalyst fix --checkIt prints one line per non-canonical item and exits 1, writing nothing. Here
messy.md has unsorted keys while tidy.md is already canonical:
<project>/notes/messy.md
exit status 1
Example GitHub Actions step#
- name: Validate content
run: |
make build
./bin/katalyst check
./bin/katalyst fix --checkThe check step enforces schema and structural checks; the fix --check
step enforces canonical frontmatter without modifying files. See
Fix for why
fix is opinionated and non-destructive in this mode.