Which YAML syntax allows a 'run:' step to span multiple shell commands across multiple lines?
Select an answer to reveal the explanation.
Short Explanation and Infographic
The pipe symbol '|' in YAML is the block scalar indicator — it preserves newlines, so each line becomes a separate shell command.
Full explanation below image
Full Explanation
The '|' YAML block scalar indicator preserves literal newlines, making each line in the block an individual shell command in the run script. This is the standard way to write multi-line run steps. The '>' folded scalar replaces newlines with spaces, collapsing everything into a single long command. '\' is a shell line continuation but requires specific handling in YAML. '&' is a shell background operator, not a YAML multi-line syntax. Using '|' is the idiomatic GitHub Actions pattern for multi-command steps.