-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: forbidden push to master with whitelist
- Loading branch information
Showing
3 changed files
with
14 additions
and
13 deletions.
There are no files selected for viewing
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
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.