Git Commit Integration with Zhu Li
Send commits to Zhu Li, then let the Code Mapper link them to Notion issues/features and draft changelog entries.
Open the iMessage setup guide for channel setup.
Requirements
- Zhu Li account with Notion connected and bootstrapped
- Zhu Li API key from
/dashboard/settings - A git repository (local or hosted)
Option A: post-commit hook
Create .git/hooks/post-commit in your repo:
#!/bin/sh
ZHULI_API_KEY="zhuli_your_api_key_here"
ZHULI_URL="https://zhuli.aevr.space/api/v1/ingest/commit"
HASH=$(git rev-parse HEAD)
MESSAGE=$(git log -1 --pretty=%B)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
AUTHOR=$(git log -1 --pretty="%an <%ae>")
REPO=$(basename "$(git rev-parse --show-toplevel)")
COMMITTED_AT=$(git log -1 --pretty=%cI)
DIFF=$(git diff HEAD~1 HEAD 2>/dev/null | head -c 20000)
curl -sf -X POST "$ZHULI_URL" \
-H "Authorization: Bearer $ZHULI_API_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -n \
--arg hash "$HASH" \
--arg message "$MESSAGE" \
--arg branch "$BRANCH" \
--arg author "$AUTHOR" \
--arg repository "$REPO" \
--arg diff "$DIFF" \
--arg committedAt "$COMMITTED_AT" \
'{hash:$hash,message:$message,branch:$branch,author:$author,repository:$repository,diff:$diff,committedAt:$committedAt}')" || true
Then run:
chmod +x .git/hooks/post-commit
Option B: GitHub Actions
Create .github/workflows/zhuli.yml:
name: Notify Zhu Li
on:
push:
branches: ["**"]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Send commit to Zhu Li
env:
ZHULI_API_KEY: ${{ secrets.ZHULI_API_KEY }}
run: |
if [[ -z "$ZHULI_API_KEY" ]]; then
echo "ZHULI_API_KEY secret is missing"
exit 1
fi
HASH=$(git rev-parse HEAD)
MESSAGE=$(git log -1 --pretty=%B)
BRANCH=${GITHUB_REF_NAME}
AUTHOR=$(git log -1 --pretty="%an <%ae>")
REPO=${GITHUB_REPOSITORY}
COMMITTED_AT=$(git log -1 --pretty=%cI)
if git rev-parse HEAD~1 >/dev/null 2>&1; then
DIFF=$(git diff HEAD~1 HEAD | head -c 20000)
else
DIFF=$(git show --format= --name-only HEAD | head -c 20000)
fi
PAYLOAD=$(jq -n \
--arg hash "$HASH" \
--arg message "$MESSAGE" \
--arg branch "$BRANCH" \
--arg author "$AUTHOR" \
--arg repository "$REPO" \
--arg diff "$DIFF" \
--arg committedAt "$COMMITTED_AT" \
'{hash:$hash,message:$message,branch:$branch,author:$author,repository:$repository,diff:$diff,committedAt:$committedAt}')
HTTP_CODE=$(curl -sS -o response.json -w "%{http_code}" -X POST "https://zhuli.aevr.space/api/v1/ingest/commit" \
-H "Authorization: Bearer $ZHULI_API_KEY" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
echo "Zhu Li API status: $HTTP_CODE"
cat response.json
if [[ "$HTTP_CODE" -lt 200 || "$HTTP_CODE" -ge 300 ]]; then
echo "Zhu Li commit ingest failed"
exit 1
fi
Where to verify
- Zhu Li dashboard:
/dashboard/commits - Notion: Commits, Issues, Features, Changelog databases
Troubleshooting
Commit ingests but no Notion update
Pipeline workers may not have run yet. Ensure cron/processor is active for /api/v1/agents/process.
jq missing
Install it:
brew install jq