diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 00000000000..de588571234 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,14 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +branch="$(git rev-parse --abbrev-ref HEAD)" +user="$(git config user.name)" +whitelist=("bubkoo" "NewByVector") + +if [[ ! " ${whitelist[@]} " =~ " ${user} " ]]; then + if [ "$branch" = "master" ]; then + echo "Push to master branch is forbidden." + echo "Checkout your owne branch then submit a pr." + exit 1 + fi +fi diff --git a/.husky/prepush b/.husky/prepush deleted file mode 100755 index a0db174fff7..00000000000 --- a/.husky/prepush +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -./scripts/pre-push-check diff --git a/scripts/pre-push-check b/scripts/pre-push-check deleted file mode 100644 index 2cd2e163fc0..00000000000 --- a/scripts/pre-push-check +++ /dev/null @@ -1,9 +0,0 @@ -#!/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