Skip to content

Instantly share code, notes, and snippets.

View hkraji's full-sized avatar

Haris Krajina hkraji

  • Sarajevo, Bosnia and Herzegovina
View GitHub Profile
@hkraji
hkraji / pre-commit
Created December 1, 2025 13:14
Pipeline CRM pre-commit hook for structure.sql protection
#!/bin/bash
# Pre-commit hook to warn about large changes to db/structure.sql
STRUCTURE_FILE="db/structure.sql"
THRESHOLD=200
# Check if structure.sql is staged for commit
if git diff --cached --name-only | grep -q "^${STRUCTURE_FILE}$"; then
# Count the number of changed lines (additions + deletions)