YAML basics
Workflows are written in YAML files that have either a .yml
or .yaml
extension. YAML (which stands for YAML Ain't Markup Language) is a data serialization language that's optimized to be directly writable and readable by humans. It is a strict superset of JSON but contains syntactically relevant newlines and indentation instead of braces. Like markdown, it also works very well with pull requests as changes are always per line. Let's look at some YAML basics that should help you get started.
Comments
A comment in YAML starts with a hash, #
:
# A comment in YAML
Scalar types
Single values can be defined using the following syntax:
key: value
Many data types are supported:
integer: 42
float: 42.0
string: a text value
boolean: true
null value: null
datetime: 1999-12-31T23:59:43.1Z
Note that keys and values can contain spaces and do not need quotation. But you can quote both keys and values with single or double quotes...