fix(ci): pr-iphone-deploy.yml fails to parse — indent python3 body inside run: | #14
Reference in New Issue
Block a user
Delete Branch "fix/ci-yaml-indent"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
pr-iphone-deploy.ymldoes not run on any PR. The workflow file fails to parse, so Gitea Actions never creates a run for it.Root cause
In PR #13, the LGTM scanner was rewritten as an inline
python3heredoc insidewait-approval'srun: |block. The python body was written at column 0:But YAML block scalars require content to be more indented than the parent key. YAML exits the block scalar at the first column-0 line (
import json, re, sys) and tries to parse the python as YAML, failing with:The result:
pr-iphone-deploy.ymlcouldn't load at all, so no run was ever created — even on PRs that touched the Swift app. The trigger fix and self-merge fix from PR #13 are both onmainand correct, but unreachable because the file doesn't parse.PR #13 was merged before this issue was noticed, so this fix ships as a separate PR.
Fix
Switch the inline python from a
<<'PY'heredoc (column-0 body) topython3 -c '...'with the body indented to sit inside therun: |block scalar. Behavior is identical — samejson.loads+\bLGTM\b/\bKO\bregexes, same sentinel-marker skip, same KO-before-LGTM precedence.Verified locally
yaml.safe_loadnow parses the workflow cleanly → jobschanges,build-deploy,wait-approval, all gates wired.actwill execute it and ran all three scenarios:Validation on merge
After merge, the next PR that touches
tabatago-swift/**should finally produce apr-iphone-deploy.ymlrun with all three jobs (changes→build-deploy→wait-approval). Watch for: no auto-merge within ~30s of the « Prêt à tester » comment (self-merge fix), thenLGTMto merge.Files
.github/workflows/pr-iphone-deploy.yml— indent python body only (1-file, ~27-line diff)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)📱 Prêt à tester !
L'app est déployée sur l'iPhone (devicectl).
📱 Prêt à tester !
L'app est déployée sur l'iPhone (devicectl).
📱 Prêt à tester !
L'app est déployée sur l'iPhone (devicectl).
LGTM