We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
develop
trunk
1 parent c8fd975 commit 4053d9dCopy full SHA for 4053d9d
.husky/pre-push
@@ -0,0 +1,16 @@
1
+#!/bin/bash
2
+. "$(dirname "$0")/_/husky.sh"
3
+
4
+# Allows us to read user input below, redirects script's input to the terminal.
5
+exec < /dev/tty
6
7
+PROTECTED_BRANCH=("develop" "trunk")
8
+CURRENT_BRANCH=$(git branch --show-current)
9
10
+if [[ " ${PROTECTED_BRANCH[@]} " =~ " ${CURRENT_BRANCH} " ]]; then
11
+ read -p "$CURRENT_BRANCH is a protected branch. Are you sure you want to push? (y/n): " confirmation
12
+ if [ "$confirmation" != "y" ]; then
13
+ echo "Push aborted"
14
+ exit 1
15
+ fi
16
+fi
changelog/avoid-accidental-push-to-develop
@@ -0,0 +1,4 @@
+Significance: minor
+Type: dev
+Dev: additional check when pushing to protected branches.
0 commit comments