Skip to content

Commit

Permalink
chore: forbidden push to master with whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Nov 9, 2022
1 parent b450a46 commit 1f42ecd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
14 changes: 14 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions .husky/prepush

This file was deleted.

9 changes: 0 additions & 9 deletions scripts/pre-push-check

This file was deleted.

0 comments on commit 1f42ecd

Please sign in to comment.