Skip to content

Commit 2426a68

Browse files
authored
chore: add hook to prevent pushing to upstream from fork (#8)
1 parent 33e2d25 commit 2426a68

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.husky/pre-push

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/sh
22

3-
set -ex
3+
set -e
4+
5+
remote_name="$1"
6+
remote_url="$2"
7+
8+
if [ -f .private ] && [ "$remote_name" == "upstream" ]; then
9+
echo "Cannot push to $remote_name because .private file exists to prevent accidental pushes."
10+
exit 1
11+
fi
412

513
pnpx lint-staged --config .config/.lintstagedrc.push.js

0 commit comments

Comments
 (0)