From 45c0e95e85d6a5e84d827f6abfd5ee168921ae13 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Sun, 27 Jul 2025 14:41:32 +0200 Subject: [PATCH] Add pre-commit hook to prevent direct commits to the main branch --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dec20d4..bf4e4c2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,12 @@ repos: - repo: local hooks: + - id: no-commit-to-main + name: Don't commit to main branch + entry: sh -c 'if [ "$(git rev-parse --abbrev-ref HEAD)" = "main" ]; then echo "Direct commits to main branch are not allowed!"; exit 1; fi' + language: system + pass_filenames: false + always_run: true - id: test-ui name: Test Frontend entry: just test-frontend