Merged in chore/block-commits-on-master (pull request #3264)

chore: block commits and pushes directly on master

* chore: block commits and pushes directly on master


Approved-by: Linus Flood
Approved-by: Matilda Landström
This commit is contained in:
Joakim Jäderberg
2025-12-02 08:05:25 +00:00
parent 84593438e6
commit 95473927f2
2 changed files with 13 additions and 0 deletions

View File

@@ -1 +1,8 @@
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "master" ] || [ "$branch" = "main" ]; then
echo "❌ You can't commit directly to $branch"
exit 1
fi
yarn dlx lint-staged yarn dlx lint-staged

6
.husky/pre-push Normal file
View File

@@ -0,0 +1,6 @@
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "master" ] || [ "$branch" = "main" ]; then
echo "❌ You can't push directly to $branch"
exit 1
fi