Skip to content

Commit 49fd700

Browse files
Chhinnaclaude
andcommitted
Fix push protection hook blocking pushes when codeant CLI is unavailable
The fallback branch in the cliPath hook used && which caused non-zero exit when neither the bundled CLI nor global codeant was found, blocking pushes even though no scan ran. Changed to || exit 0 to match the non-cliPath branch behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 010fe50 commit 49fd700

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/installPushProtectionHook.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ function buildHookBlock(cliPath) {
2828
if [ -f "${cliPath}" ]; then
2929
node "${cliPath}" secrets --committed --hook
3030
else
31-
command -v codeant >/dev/null 2>&1 && codeant secrets --committed --hook
31+
command -v codeant >/dev/null 2>&1 || exit 0
32+
codeant secrets --committed --hook
3233
fi
3334
${HOOK_MARKER_END}`;
3435
}

0 commit comments

Comments
 (0)