diff --git a/.github/workflows/pr-iphone-deploy.yml b/.github/workflows/pr-iphone-deploy.yml index 65f4802..ce991bc 100644 --- a/.github/workflows/pr-iphone-deploy.yml +++ b/.github/workflows/pr-iphone-deploy.yml @@ -253,34 +253,33 @@ jobs: COMMENTS=$(curl -s -H "Authorization: token ${GT_TOKEN}" \ "${API}/issues/${PR}/comments?limit=50&page=1") - DECISION=$(python3 - "$COMMENTS" <<'PY' -import json, re, sys -MARKER = "" -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 -) + DECISION=$(python3 -c ' + import json, re, sys + MARKER = "" + 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 comments — their 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") case "$DECISION" in LGTM)