add git hooks for commit validation, auto-suggestions, and Docker build/push automation on git push

This commit is contained in:
Egor Pozharov
2026-04-21 12:54:39 +06:00
parent bf62714d0d
commit 60dea22ced
5 changed files with 136 additions and 4 deletions

17
.githooks/post-commit Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Post-commit hook: show info after successful commit
COMMIT_HASH=$(git rev-parse --short HEAD)
COMMIT_MSG=$(git log -1 --pretty=%s)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo ""
echo "✅ Commit created: $COMMIT_HASH"
echo "📝 Message: $COMMIT_MSG"
echo "🌿 Branch: $BRANCH"
echo ""
# Remind to push if needed
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
echo "💡 Tip: Run 'git push' to trigger deployment"
fi