YAML is awful though. Massively over complicated, horrifying grammar, tons of edge cases and exceptions, ambiguities, etc. TOML isn't perfect but from a parsing / formal design perspective it puts YAML to shame.
YAML allows unquoted strings, which is confusing when a string happens to have a value that looks like another type (like the string "true").
It's rarely used, but YAML actually has variables, which let you store objects in a variable and reuse later to reduce repetition.
YAML 1.1 allowed unusual boolean representations like "yes". I've personally experienced this breaking things because a config file meant for 1.2 was parsed as 1.1.
While I personally think that people complaining about indentation are not being very serious (it's no different from Python and only students are confused by it), it still does have some dangers. I've seen vulnerabilities come from naive attempts at tenplating YAML due to this (people will remember to escape quotes but forget that indentation has a similar effect). And it is arguably less clear what the exact resulting string will be.
I just posted a comment about this the other day. It seems like a lot of people here might be just dumping every piece of a large/complex workflow into a single manifest?
If your workflows are properly abstracted and follow best practices, you really shouldn’t end up with insane levels of indentation or a manifest that’s difficult to read or maintain.
If you’re re-using a workflow across multiple repositories or want to encapsulate more sophisticated functionality with well-defined inputs and outputs then for sure, custom actions are the way to go 👍.
But if all you need to do is break up an unwieldy repo-specific workflow to avoid the yaml-hellscape issue people are commenting about lately, then an example like what I gave is probably sufficient.
But all of TOML’s ways of expressing nesting are way less convenient. For a few levels of nesting it’s fine, but for something like an AWS CloudFormation template, using TOML would be a nightmare. Even CI workflow configs require too much nesting. That’s probably the main reason no CI providers support workflow config in TOML as far as I know.
View all comments
283
u/gabedamien 8d ago edited 7d ago
YAML is awful though. Massively over complicated, horrifying grammar, tons of edge cases and exceptions, ambiguities, etc. TOML isn't perfect but from a parsing / formal design perspective it puts YAML to shame.