Skip to content

Instantly share code, notes, and snippets.

@brunofarache
Last active August 15, 2019 01:56
Show Gist options
  • Save brunofarache/700fa2f65300a26f64fd29916656a37c to your computer and use it in GitHub Desktop.
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
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