diff --git a/package.json b/package.json index da34e79e718..cdde22f00aa 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "husky": { "hooks": { "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged && lerna run --concurrency 1 --stream precommit" + "pre-commit": "lint-staged && lerna run --concurrency 1 --stream precommit", + "prepush": "./scripts/pre-push-check.sh" } }, "lint-staged": { diff --git a/scripts/pre-push-check.sh b/scripts/pre-push-check.sh new file mode 100644 index 00000000000..2cd2e163fc0 --- /dev/null +++ b/scripts/pre-push-check.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +branch="$(git rev-parse --abbrev-ref HEAD)" + +if [ "$branch" = "master" ]; then + echo "Push to master branch is forbidden." + echo "Checkout your owne branch then submit a pr." + exit 1 +fi \ No newline at end of file