GitHub Actions accepts invalid YAML
59 points by yossarian
59 points by yossarian
YAML moment. I’m not shocked at all.
Another fun thing with GitHub Actions' YAML is that they have an on key to define when the workflow should run. For example, in their quickstart they use:
on: [push]
but of course, this is YAML, so this is semantically equivalent to:
true: [push]
Fortunately, they also support this syntax for the sanity of people who generate their YAML, but it's undocumented:
'on': [push]
On GitHub's side, I'm not sure if they have a clean path towards spec conformance here.
Are you referring to the fact that fixing this parsing issue would break some users' existing workflows? Hopefully they don't go down the path of adding a "quirks mode" to the parser!
Yeah, exactly. Historically GitHub has shown great hesitance when it comes to breaking Actions, even when it would make the ecosystem more correct as a whole. I think that's been changing recently (e.g. with the renewed attention on dangerous triggers like pull_request_target) however, so who knows!
a "quirks mode"
I can't make up my mind on if wanting to make YAML accept even MORE quirky stuff is a) utterly insane or b) business as usual, it's YAML after all.
the concept of valid yaml is an oxymoron
It actually has a very clear spec (and an excellent test suite). YAML's problem is that it's complex, not that it's unclear whether or not it's valid.
Hehe. I took parent's comment to mean that you can write valid yaml but because the spec is so complex, you can't really eyeball it to be correct. Significantl whitespace (dumbest decision ever) doesn't help.
Is your claim here that whatever lib GH is using doesn't test the test suite?
Is it possible the test suite doesn't cover this case? the linked part of the spec seems pretty clear but I guess testing all parse failures is tricky...
I remember being extremely excited to move CI/CD pipelines to GH, but I think since adopting GH Actions, it has been a consistent, albeit slow, decline in satisfaction. Just so many curious product decisions that leave me scratching my head.
Whenever I get these thoughts, I remember what it was like to use Travis-CI, AppVeyor, Azure CI. For open source projects, GitHub Actions was like a breath of fresh air.
In terms of configuration, the nicest setup I ever had was Buildbot, but I was responsible for setting up containerisation and integration with the GitHub web interface, and I'm just not that much of a sysadmin, so it never became particularly polished.
Just stop using all together. It's about time really.
what are the alternatives to github?
Gitlab, sourcehut, codeberg, self-hosted gitea++, just running a server and ssh-ing into it.
You're telling me that making whitespace significant has literally invisible foot guns?
I am shocked, I tell you, shocked.
Well not that shocked actually.
Yet. Another. Migraine. Looming. I will die on this hill.