From 95473927f2a5c9049713e9d9cb5eebfe16191f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20J=C3=A4derberg?= Date: Tue, 2 Dec 2025 08:05:25 +0000 Subject: [PATCH] Merged in chore/block-commits-on-master (pull request #3264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .husky/pre-commit | 7 +++++++ .husky/pre-push | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 .husky/pre-push diff --git a/.husky/pre-commit b/.husky/pre-commit index bae616c39..d8fae09fc 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -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 diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 000000000..0e2cd551e --- /dev/null +++ b/.husky/pre-push @@ -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