Skip to content

Commit

Permalink
feat: pre-push 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
suhwan2004 committed Oct 15, 2024
1 parent 3390d69 commit bbdd984
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
echo "🐶 Running git push"

FORBIDDEN_HTTPS_URL="https://github.com/CollaBu/pennyway-client-webview-next.git"
FORBIDDEN_SSH_URL="[email protected]:CollaBu/pennyway-client-webview-next.git"
FORBIDDEN_REF="refs/heads/main"

remote="$1"
url="$2"

if [ "$url" != "$FORBIDDEN_HTTPS_URL" -a "$url" != "$FORBIDDEN_SSH_URL" ]
then
exit 0
fi

if read local_ref local_sha remote_ref remote_sha
then
if [ "$remote_ref" == "$FORBIDDEN_REF" ]
then
echo "🐶 Do not push to the main Branch"
exit 1
fi
fi

exit 0

0 comments on commit bbdd984

Please sign in to comment.