network/.githooks/pre-push
anonpenguin23 11ce4f2a53 feat: add pre-commit hook for automatic changelog updates
- Introduced a pre-commit hook that updates the changelog if there are code changes, excluding commits that only modify the changelog or Makefile.
- Added user confirmation for proceeding with the commit after displaying the changelog preview.
- Enhanced the update_changelog.sh script to differentiate between pre-commit and pre-push contexts for better change analysis.
2025-11-03 07:34:42 +02:00

19 lines
407 B
Bash

#!/bin/bash
# Colors for output
CYAN='\033[0;36m'
GREEN='\033[0;32m'
RED='\033[0;31m'
NOCOLOR='\033[0m'
# Run tests before push
echo -e "\n${CYAN}Running tests...${NOCOLOR}"
go test ./... # Runs all tests in your repo
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}Push aborted: some tests failed.${NOCOLOR}"
exit 1
else
echo -e "${GREEN}All tests passed. Proceeding with push.${NOCOLOR}"
fi