diff --git a/.githooks/pre-push b/.githooks/pre-push index f349967..17fac2c 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -15,26 +15,34 @@ matched=false seen_refs=false - echo "$hook_input" | while IFS=' ' read -r _ _ remote_ref _; do + # Use here-string instead of pipeline to preserve variable scope + while IFS=' ' read -r _ _ remote_ref _; do seen_refs=true case "$remote_ref" in refs/heads/testing|refs/heads/staging|refs/heads/main|refs/heads/production) echo "Matched deployable branch: ${remote_ref#refs/heads/}" - exit 0 + matched=true + # Continue reading all refs; do not exit here to process all ;; *) echo "Non-deployable branch: ${remote_ref#refs/heads/}" ;; esac - done + done <