Created
January 14, 2021 10:05
-
-
Save oneEyedSunday/35e5a23bfc55e41583787fa182bdaf38 to your computer and use it in GitHub Desktop.
Pre Push hook to run dotnet builds
This file contains 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
#!/bin/sh | |
branch="$(git rev-parse --abbrev-ref HEAD)" | |
## custom | |
BASEDIR=$(dirname "$0") | |
echo "Running Builds for DotNet Projects before Push for Branch: " $branch | |
set -e | |
dotnet build -c RELEASE "$BASEDIR/../../path/to/projects" | |
# Things you need to do - | |
# 1. Copy above code | |
# 2. Go to your project/.git/hooks | |
# 3. Copy pre-push.sample and rename it to pre-push | |
# 4. Paste the above code | |
# 5. Make this file executable - $ chmod +x .git/hooks/pre-commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ref here