mirror of
https://github.com/sasjs/core.git
synced 2025-12-11 06:24:35 +00:00
Merge pull request #106 from sasjs/hook
chore: adding hook script to prevent accidental commits to master
This commit is contained in:
@@ -1,2 +1,11 @@
|
||||
#!/bin/sh
|
||||
sasjs lint
|
||||
sasjs lint
|
||||
|
||||
# Avoid commits to the master branch
|
||||
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
|
||||
if [[ "$BRANCH" =~ ^(master|main|develop)$ ]]; 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
|
||||
Reference in New Issue
Block a user