GitHub Actions runs workflows that break the YAML standard
Published
This English page is a machine translation of the Korean original, so some phrasing may read awkwardly.
William Woodruff, who created the workflow security checker zizmor, explained that some workflows GitHub Actions accepts cannot be read by a YAML parser that follows the standard.
Read the original at William Woodruff's blog ↗
CI for most GitHub repositories runs on YAML files kept in the workflows folder. GitHub reads and runs these files, but security checkers and editors read the same files too. On November 22, William Woodruff, who created the workflow security checker zizmor, posted that the two sides read the same file differently. GitHub Actions accepts several kinds of syntax that break the YAML standard, so a parser that follows the standard cannot read some real-world workflows.
It started with a bug report that Woodruff had been unable to resolve for a year and a half. zizmor rejected a user's workflow, yet the same workflow ran without trouble on GitHub. The cause was the last line of a multi-line JSON string wrapped in single quotes. The YAML 1.2.2 specification requires such a value, when placed inside a list or map, to be indented at least one space more than its parent. That workflow was one space short on the closing line.
At first, Woodruff himself did not realize this was a violation of the standard. So he sent a change to tree-sitter-yaml, the parser zizmor uses, to accept this syntax. Now that he knows the cause, he has opened a pull request to revert that change. He admitted that the YAML specification is so large and complicated that it did not even occur to him it was a violation.
The GitHub side looks hard to fix. Most of the code behind Actions is proprietary, so Woodruff did not state it as fact. But based on the public runner code, he concluded that it uses YamlDotNet 5.3.0, a .NET library released in 2018. Upgrading to the latest version, 18.1.0, would not remove this bug. That is because a 2020 fix only corrected double-quoted strings, and he suspects this happened because the official YAML test suite only tests this rule with a double-quoted string.
What stands out in this story is who decides the standard. Until now, it was easy to assume that whoever follows the specification is right and whoever breaks it should fix their side. But if countless repositories have already written workflows the way GitHub accepts them, that leniency becomes the de facto standard. A tool that reads by the specification fails to read real workflows, and to users it looks like the broken one.
How the bug came to be only half fixed is also worth thinking about. The rule in the specification applies equally to single and double quotes, but the official tests only covered one of them, and the fix only went as far as the tests did. Once tests start standing in for the specification, the untested half becomes a rule nobody enforces.
For people writing workflows, the fix is simple. If you wrapped a multi-line string in quotes, indent the closing line one space more than its parent. In this case, too, adding a single space made the file valid YAML. When a checking tool says it cannot read a workflow, it is faster to first see whether the file follows the standard before suspecting a bug in the tool.
In the end, a platform accepting a syntax does not make that syntax correct. Since Woodruff also saw no clear path for GitHub to conform to the standard, keeping your own files standard-compliant will last longer than waiting for the platform to change.
Sources
- William Woodruff: TIL: GitHub Actions accepts invalid YAML, November 22, 2026.
- YAML 1.2.2 specification, section 8.2.3: Block Nodes.
- zizmor issue #1116, the issue containing the originally reported workflow.
A question to think about
Does your team's checking tool follow the standard, or the platform that actually runs your code?