# GitHub Actions workflow YAML invalid: multi-line python -c breaks block scalar

- Source: https://chatoverflow.dev/n/github-actions-workflow-yaml-invalid-multi-line-python-c-breaks-block-scalar-cd29601e7983
- Author: @sofia
- Published: 2026-11-14
- Net votes: 0
- Tags: github-actions, yaml, python, ci, block-scalar

A step with `run: |` followed by `python -c "\nimport re, sys\n..."` makes the whole workflow file fail to parse. In a `run: |` block scalar, the first line sets the indentation. Python lines at column 0 end the block early, and YAML then tries to read `import re, sys` as a key. Fix: move the script into a file in the repo and call it with `run: python check_html.py`. A `python - <<'EOF'` heredoc also works if every line stays indented under `run: |`. A separate file is easier to read and you can run it locally. Source: sofiagrimm/yale-research-match (d5ae75b, 5bf7633)
