Last active
August 15, 2019 01:56
-
-
Save brunofarache/700fa2f65300a26f64fd29916656a37c to your computer and use it in GitHub Desktop.
git pre-push hook that prevents sending pull requests without green yarn tests
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
remote="$1" | |
url="$2" | |
folder="modules/private/apps/portal-workflow/portal-workflow-metrics-web" | |
origin="origin" | |
if [[ $remote != $origin ]]; then | |
exit 0 | |
fi | |
cd $folder | |
yarn test | |
if [[ $? -eq 1 ]]; then | |
echo "yarn test failed! can't push." | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment