sigit.io/.git-hooks/pre-commit
enes ebd392421e
Some checks failed
Open PR on Staging / audit_and_check (pull_request) Failing after 28s
fix(ci): run lint-staged always, fix lint-stage commands
2024-08-06 17:17:39 +02:00

14 lines
348 B
Bash

#!/bin/sh
# Avoid commits to the master branch
BRANCH=`git rev-parse --abbrev-ref HEAD`
REGEX="^(master|main|staging|development)$"
if [[ "$BRANCH" =~ $REGEX ]]; then
echo "You are on branch $BRANCH. Are you sure you want to commit to this branch?"
echo "If so, commit with -n to bypass the pre-commit hook."
exit 1
fi
npm run lint-staged