The issues you had just proves that YAML based CI approach always leads to troubles with time. And yeah, I have been there, code generators for YAML. Hundreds of lines for YAML pipelines, etc ))
It allows the CI engine to determine which jobs to start, what their steps are etc.
Yep, like a said , I don't mind to have such a configuration inside YAML, but this should NOT be pipeline code itself )