mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-12-11 08:18:49 +00:00
- 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.
19 lines
407 B
Bash
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
|