DocsGuides
Use in CI and git hooks
Automate knowledge drift checks and PR diff reviews with GitHub Actions and pre-commit hooks.
$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 --checkand fails when.athena/is out of date. - On pull requests it also runs
athena reviewagainst the PR base, and fails on blockers: possible secrets and committed.envfiles. - With
comment: trueit posts one PR comment and updates it on later pushes (the workflow needspermissions: pull-requests: write; forks get a read-only token, so the comment is skipped with a warning). - Inputs:
check-sync(defaulttrue),review(defaulttrue),review-base,comment(defaultfalse),version(defaultlatest),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 installblocks commits when.athena/knowledge is out of date. Add--reviewto also block commits containing possible secrets.athena git-hook statusshows whether it's installed;athena git-hook uninstallremoves only Athena's part.- An existing shell
pre-commithook 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 --checkto 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.