Guides/Use in CI and git hooks
DocsGuides

Use in CI and git hooks

Automate knowledge drift checks and PR diff reviews with GitHub Actions and pre-commit hooks.

New in v0.2.0
$athena git-hook install

GitHub Action

Add Athena to your workflow:

yaml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0 # the review diffs the pull request against its base commit
- uses: Sabari-Vasan-SM/athena@v0
  with:
    comment: true
  • Runs athena sync --check and fails when .athena/ is out of date.
  • On pull requests it also runs athena review against the PR base, and fails on blockers: possible secrets and committed .env files.
  • With comment: true it posts one PR comment and updates it on later pushes (the workflow needs permissions: pull-requests: write; forks get a read-only token, so the comment is skipped with a warning).
  • Inputs: check-sync (default true), review (default true), review-base, comment (default false), version (default latest), working-directory (default .), github-token. Outputs: in-sync, blockers.
  • Runs on Linux and macOS runners; Windows runners are not supported.
  • Findings show the type and file location only, never the matched value.

Pre-commit Hook

  • athena git-hook install blocks commits when .athena/ knowledge is out of date. Add --review to also block commits containing possible secrets.
  • athena git-hook status shows whether it's installed; athena git-hook uninstall removes only Athena's part.
  • An existing shell pre-commit hook is kept: Athena adds a marked block to it, and uninstall restores the original.
  • Teammates without Athena installed are not blocked.
  • If you use husky, lefthook or pre-commit, add npx --no-install athena sync --check to their config instead.

Example Project

Check out the demo-shop example: A small Express + Prisma app with its generated .athena/ committed, so you can see real output before installing.