Skip to content

Commit 0773ecf

Browse files
authored
Merge pull request #18 from RoboFinSystems/chore/skip-githooks-in-ci
chore(githooks): skip hooks in CI environments
2 parents c347dc3 + 58819d1 commit 0773ecf

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎.githooks/pre-commit‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4+
# Skip in CI: dedicated jobs run these checks and branch protection is enforced
5+
# server-side. These hooks are a local-only safety net.
6+
if [ -n "${CI:-}" ]; then exit 0; fi
7+
48
# Run checks individually so a failure stops early and is clearly attributed.
59
# Use check-only variants (no --write / --fix) — auto-fixing mid-commit leaves
610
# the working tree out of sync with the snapshot git is about to commit.

‎.githooks/pre-push‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
# GitHub branch protection is the server-side backstop; this is the local guard.
88
set -euo pipefail
99

10+
# Skip in CI: dedicated jobs run these checks and branch protection is enforced
11+
# server-side. These hooks are a local-only safety net.
12+
if [ -n "${CI:-}" ]; then exit 0; fi
13+
1014
protected='^refs/heads/(main|master|release/.*)$'
1115

1216
while read -r _local_ref _local_sha remote_ref _remote_sha; do

0 commit comments

Comments
 (0)