feat: add push-reminder hook (opt-in, disabled by default)
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"description": "Gitea connector hooks — push reminder after commits (opt-in)",
|
||||||
|
"hooks": {}
|
||||||
|
}
|
||||||
Executable
+19
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# push-reminder.sh — nudges you to push after a commit
|
||||||
|
# Reads Bash tool output from stdin (JSON), checks if a git commit happened.
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
INPUT=$(cat)
|
||||||
|
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // ""')
|
||||||
|
TOOL_RESULT=$(echo "$INPUT" | jq -r '.tool_result // ""')
|
||||||
|
|
||||||
|
# Only trigger on Bash tool
|
||||||
|
[[ "$TOOL_NAME" == "Bash" ]] || exit 0
|
||||||
|
|
||||||
|
# Check if the output looks like a successful git commit
|
||||||
|
if echo "$TOOL_RESULT" | grep -qE '^\[.+\]\s+\S+'; then
|
||||||
|
echo '{"decision":"approve","systemMessage":"Commit detected! Friendly reminder: run `gitea push` to send it to git.sethpc.xyz. Unpushed commits are just really elaborate local notes."}'
|
||||||
|
else
|
||||||
|
echo '{"decision":"approve"}'
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user