diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit index 47f074acd9..733792bd8c 100755 --- a/.github/hooks/pre-commit +++ b/.github/hooks/pre-commit @@ -3,12 +3,15 @@ [ -n "$CI" ] && exit 0 -yarn lint-staged --relative -lintStatus=$? +GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) +if [ "$GIT_BRANCH" = "main" ]; then + yarn lint-staged --relative + lintStatus=$? -if [ $lintStatus -ne 0 ]; then - echo "❌ Linting failed" - exit 1 + if [ $lintStatus -ne 0 ]; then + echo "❌ Linting failed" + exit 1 + fi fi green='\033[0;32m'