From d1ce39bd7b649fa1c66d94133bf00d217da2f4e2 Mon Sep 17 00:00:00 2001 From: Rodin Date: Fri, 15 May 2026 18:50:58 -0700 Subject: [PATCH] fix(ci): escape regex \s and \b as JSON string literals in jq filter jq parses the test() argument as a JSON string, so \s and \b must be double-escaped (\\s, \\b) to produce literal \s and \b after JSON string parsing. Single backslash forms are invalid JSON escapes and cause a compile error. --- .gitea/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index fddf158..894c127 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: TTL_MIN=${SELF_REVIEW_TTL_MIN} COMMENTS=$(curl -sS -H "Authorization: token $GITEA_TOKEN" "$API/repos/$REPO/issues/$PR/comments?limit=200") - HAS_SR=$(echo "$COMMENTS" | jq -r --arg sha "$SHA" '[.[] | select(.user.login=="rodin") | select(.body|contains("Self-review against "+$sha)) | select(.body|test("(?im)^###\s+Doc consistency\b"))] | length') + HAS_SR=$(echo "$COMMENTS" | jq -r --arg sha "$SHA" '[.[] | select(.user.login=="rodin") | select(.body|contains("Self-review against "+$sha)) | select(.body|test("(?im)^###\\s+Doc consistency\\b"))] | length') if [ "$HAS_SR" -gt 0 ]; then ALLOW=true