fix(process): drain label input before reporting guard membership (#793)

Avoid grep -q closing the pipe before printf completes under pipefail.
Exercise the actual guard with a large label snapshot and retain refusal cases.

Issue: #793
User-Visible: no
This commit is contained in:
Matysh
2026-10-05 09:29:54 +03:00
parent 9ebc430983
commit 841bad4e79
2 changed files with 38 additions and 3 deletions
+3 -1
View File
@@ -83,7 +83,9 @@ jobs:
# снимок события об этом не знает, а исполнять отозванный запрос нельзя.
current=$(gh issue view "$NUM" --repo "$REPO" --json labels --jq '.labels[].name')
labels=$(printf '%s\n' "$current" | paste -sd, -)
has() { printf '%s\n' "$current" | grep -qx -- "$1"; }
# Не grep -q: раннее закрытие pipe даёт printf SIGPIPE, а pipefail
# превращает найденную метку в ложный отказ (#793). Читаем до конца.
has() { printf '%s\n' "$current" | grep -Fx -- "$1" > /dev/null; }
BLOCKED=false; EXHAUSTED=false
has blocked && BLOCKED=true
has review-4 && EXHAUSTED=true