The inline python3 -c body in wait-approval raised IndentationError: unexpected indent because YAML block scalars dedent content to the first line's indent, leaving the python body with leading whitespace.
Replace with a call to scripts/pr_lgtm_scanner.py (added in the previous commit). Add a shallow Checkout step to wait-approval so the script is present on the runner.
This is the third indentation fix attempt for this scanner:
- column-0 python → YAML parse failure
- indented python → Python IndentationError
- standalone file → no indentation concerns (this commit)
Standalone Python scanner extracted from the inline python in wait-approval. Embedding multi-line Python in a YAML run: | block scalar is fragile: YAML dedents block-scalar content to the first line's indent, which produced both YAML parse failures and Python IndentationErrors in earlier iterations of this workflow. A standalone script file sidesteps all of that and is testable locally.
Behavior preserved:
- json.loads + \bLGTM\b / \bKO\b word-boundary regex (case-insensitive)
- skip bot comments tagged with <!-- tabatago:ready-to-test -->
- KO checked BEFORE LGTM (PR with both signals blocks)
Verified locally across 8 scenarios (bot-only, LGTM, KO, both, empty, usage error, KOM/LGTMX non-match, case-insensitive).
The python3 inline script in wait-approval was written at column 0 (lines 257-283), but YAML block scalars require content to be more indented than the parent key. YAML exited the run: | block at the first column-0 line ("import json, re, sys") and tried to parse the python as YAML, failing with "could not find expected :" at line 257 — which prevented pr-iphone-deploy.yml from running at all (no run was ever created for PRs that touched only the workflow file).
Fix: switch to python3 -c with the body indented to sit inside the run: | block scalar.
Verified locally:
- yaml.safe_load parses the workflow cleanly (jobs: changes, build-deploy, wait-approval).
- The extracted python, run exactly as act will execute it, returns:
bot-only -> PENDING (was self-merging before)
bot + reviewer LGTM -> LGTM (squash-merge still fires)
bot + reviewer KO -> KO (block still fires)