1 Commits

Author SHA1 Message Date
e2532a8136 Merge pull request 'fix(ci): pr-iphone-deploy no longer self-merges on its own comment' (#13) from fix/ci-lgtm-self-match into main
All checks were successful
CI / Detect Changes (push) Successful in 4s
Admin Web Docker / Docker Build Validation (push) Has been skipped
Admin Web Docker / Semantic Release (push) Successful in 12s
CI / YouTube Worker (push) Has been skipped
Admin Web Docker / Build & Push Docker Image (push) Successful in 53s
CI / Deploy (push) Has been skipped
Admin Web Docker / Admin Web Tests (push) Successful in 33s
Reviewed-on: #13
2026-07-19 22:16:12 +02:00

View File

@@ -253,33 +253,34 @@ jobs:
COMMENTS=$(curl -s -H "Authorization: token ${GT_TOKEN}" \
"${API}/issues/${PR}/comments?limit=50&page=1")
DECISION=$(python3 -c '
import json, re, sys
MARKER = "<!-- tabatago:ready-to-test -->"
try:
comments = json.loads(sys.argv[1] or "[]")
except Exception:
comments = []
lgtm = re.compile(r"\bLGTM\b", re.IGNORECASE)
ko = re.compile(r"\bKO\b", re.IGNORECASE)
hit_lgtm = hit_ko = False
for c in comments:
body = c.get("body") or ""
if MARKER in body:
# Skip bot commentstheir body contains LGTM/KO as reviewer
# instructions and would otherwise self-trigger a merge.
continue
if ko.search(body):
hit_ko = True
if lgtm.search(body):
hit_lgtm = True
if hit_ko:
print("KO")
elif hit_lgtm:
print("LGTM")
else:
print("PENDING")
' "$COMMENTS")
DECISION=$(python3 - "$COMMENTS" <<'PY'
import json, re, sys
MARKER = "<!-- tabatago:ready-to-test -->"
try:
comments = json.loads(sys.argv[1] or "[]")
except Exception:
comments = []
lgtm = re.compile(r"\bLGTM\b", re.IGNORECASE)
ko = re.compile(r"\bKO\b", re.IGNORECASE)
hit_lgtm = hit_ko = False
for c in comments:
body = c.get("body") or ""
if MARKER in body:
# Skip the bot's own "Ready to test" comment — its body mentions
# LGTM/KO as instructions and would otherwise self-trigger.
continue
if ko.search(body):
hit_ko = True
if lgtm.search(body):
hit_lgtm = True
if hit_ko:
print("KO")
elif hit_lgtm:
print("LGTM")
else:
print("PENDING")
PY
)
case "$DECISION" in
LGTM)