diff --git a/.githooks/pre-commit b/.githooks/pre-commit index a2f481f..331a6c0 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -euo pipefail +# Skip in CI: dedicated jobs run these checks and branch protection is enforced +# server-side. These hooks are a local-only safety net. +if [ -n "${CI:-}" ]; then exit 0; fi + # Run checks individually so a failure stops early and is clearly attributed. # Use check-only variants (no --fix / no write) — auto-fixing mid-commit # leaves the working tree out of sync with the snapshot git is about to commit. diff --git a/.githooks/pre-push b/.githooks/pre-push index 47dfb8b..8e6e2df 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -7,6 +7,10 @@ # GitHub branch protection is the server-side backstop; this is the local guard. set -euo pipefail +# Skip in CI: dedicated jobs run these checks and branch protection is enforced +# server-side. These hooks are a local-only safety net. +if [ -n "${CI:-}" ]; then exit 0; fi + protected='^refs/heads/(main|master|release/.*)$' while read -r _local_ref _local_sha remote_ref _remote_sha; do