Why is on: in my GitHub Actions workflow flagged?
Because PyYAML and other YAML 1.1 readers take an unquoted on as true, so a Python script reading the workflow sees the key True. GitHub reads it as the word, which is why the workflow runs. The JSON has "on", the YAML 1.2 reading.
Can JSON hold several documents?
No, a JSON file is one value, so the documents of a multi-document YAML file become the items of one array. A Kubernetes file holding a Deployment and a Service gives an array of two objects.
Is the order of the keys kept?
Yes, as the YAML has them, with merged keys in the place of the <<. Tick Sort keys for A to Z instead, which makes two JSON files easier to compare.
Why is 2024-01-01 a string and not a date?
JSON has no date type, and YAML 1.2 reads an unquoted date as text anyway. A YAML 1.1 reader would make it a date, so the value is flagged, with its line.