Skip to content

Commit 8b82b97

Browse files
Chhinnaclaude
andcommitted
Fix pre-push hook not showing interactive bypass prompt
Git pipes ref data to hook stdin, making process.stdin.isTTY false. Added `exec < /dev/tty` to reopen stdin from the terminal so the interactive bypass prompt works. Silently fails in CI environments. Bump to v0.4.3. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a3af553 commit 8b82b97

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [0.4.3] - 06/04/2026
4+
- Interactive terminal for pre-push
5+
36
## [0.4.2] - 06/04/2026
47
- Dynamic config
58

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeant-cli",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"description": "Code review CLI tool",
55
"type": "module",
66
"bin": {

src/utils/installPushProtectionHook.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function buildHookBlock(cliPath) {
2525
# Auto-installed by CodeAnt AI — blocks pushes containing secrets.
2626
# To disable: delete this hook or run "codeant push-protection disable"
2727
# Uses the CLI bundled with the VS Code extension.
28+
# Reopen stdin from terminal so the CLI can show an interactive bypass prompt.
29+
# In non-interactive environments (CI), this silently fails and the push is blocked.
30+
exec < /dev/tty 2>/dev/null || true
2831
if [ -f "${cliPath}" ]; then
2932
node "${cliPath}" secrets --committed --hook
3033
else
@@ -36,6 +39,7 @@ ${HOOK_MARKER_END}`;
3639
return `${HOOK_MARKER}
3740
# Auto-installed by CodeAnt AI — blocks pushes containing secrets.
3841
# To disable: delete this hook or run "codeant push-protection disable"
42+
exec < /dev/tty 2>/dev/null || true
3943
command -v codeant >/dev/null 2>&1 || exit 0
4044
codeant secrets --committed --hook
4145
${HOOK_MARKER_END}`;

0 commit comments

Comments
 (0)