Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 4 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down