Menu
Public repository / f977d6331fe5192e19cc1bd3bd3d79ba02bc2361
AkurAI-Framework / scripts/hooks/pre-commit
Latest change 2fbdb9ef20bb6f998f6b466eca5a508facd20968 - template: add raw blocks and fix release changelog flow by Ólafur Búi Ólafsson
#!/usr/bin/env bash
#
# pre-commit — changelog nudge (non-blocking).
#
# Policy: every feature ships its public changelog entry (`site/content/changelog.md`)
# in the SAME commit. Developer-facing release history now lives in AkurAI Notes,
# not a repo-root `CHANGELOG.md`. This hook reminds you when a commit touches
# code (crates/** or site/frontend/**) but does not also stage the site
# changelog. It is a nudge, not a gate — it always exits 0, so it never wedges a
# legitimate docs-only, refactor, or work-in-progress commit.
#
# Enable for this repo: git config core.hooksPath scripts/hooks
#
# Dependency-free: just `git` and `grep`.
staged="$(git diff --cached --name-only)"
# Did this commit touch shipping code?
code_changed="$(printf '%s\n' "$staged" | grep -E '^(crates/|site/frontend/)' || true)"
# Was the public changelog staged alongside it?
changelog_staged="$(printf '%s\n' "$staged" | grep -E '^site/content/changelog\.md$' || true)"
if [ -n "$code_changed" ] && [ -z "$changelog_staged" ]; then
{
echo ""
echo " ⚠ CHANGELOG reminder ───────────────────────────────────────────"
echo " This commit changes code (crates/ or site/frontend/) but does"
echo " not stage site/content/changelog.md."
echo ""
echo " Policy: every feature ships its changelog entry in the SAME"
echo " commit — add an entry under '## Unreleased' in:"
echo " site/content/changelog.md (visitor-facing, curated)"
echo ""
echo " Detailed developer release notes live in AkurAI Notes."
echo ""
echo " If this is a refactor / docs-only / WIP commit, ignore this."
echo " ─────────────────────────────────────────────────────────────────"
echo ""
} >&2
fi
# Always non-blocking — a nudge, never a gate.
exit 0