-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3390d69
commit bbdd984
Showing
1 changed file
with
24 additions
and
0 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,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 |