Created
May 6, 2026 04:35
-
-
Save devarops/7ffb3d67af67dfa458ff54aa1fc69ab1 to your computer and use it in GitHub Desktop.
.git/hooks/pre-push
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # pre-push hook to run checks before pushing | |
| CONTAINER_NAME="${PWD##*/}_ci" | |
| echo "==========================================" | |
| echo "🚀 Running pre-push checks in Docker..." | |
| echo "==========================================" | |
| # Run the project's check suite inside the container | |
| docker exec "$CONTAINER_NAME" make check | |
| # Capture the exit status | |
| RESULT=$? | |
| if [ $RESULT -ne 0 ]; then | |
| echo "" | |
| echo "❌ Pre-push checks failed. Push aborted." | |
| echo "Review the errors above and fix them before pushing." | |
| echo "==========================================" | |
| exit 1 | |
| fi | |
| echo "" | |
| echo "✅ All checks passed. Proceeding with push..." | |
| echo "==========================================" | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment