Skip to content

Commit d6adff3

Browse files
authored
Merge pull request #10 from CodeAnt-AI/feat/interactive-tty-hook
Fix pre-push hook interactive bypass prompt
2 parents 766b801 + 2aac701 commit d6adff3

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ 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-
if [ -f "${cliPath}" ]; then
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
31+
if [ -f "${cliPath}" ] && command -v node >/dev/null 2>&1; then
2932
node "${cliPath}" secrets --committed --hook
3033
else
3134
command -v codeant >/dev/null 2>&1 || exit 0
@@ -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)