GitHub Actions accepts invalid YAML
GitHub Actions, a popular platform for automating software development workflows, has been found to accept certain invalid YAML inputs, making it challenging to parse real-world action and workflow definitions with a conforming YAML parser. This issue is related to a bug reported by a user in April of this year, which remained unresolved despite efforts to "fix" it.
According to the YAML specification, flow-style nodes that are nested inside a block-style parent collection, such as a map or array, must be indented by at least one additional space than the parent block collection. However, GitHub Actions seems to accept flow-style nodes that do not adhere to this rule. Notably, the issue arises when a multi-line flow-style string is used for the json: key in a step definition, which is not valid YAML.
The problem was first reported by a user and subsequently opened as issue tree-sitter-yaml#36 to address the issue. However, the fix was later reverted in tree-sitter-yaml#51, acknowledging that the issue persisted. GitHub's side of the problem is less clear, as much of their codebase is proprietary. Nevertheless, it is likely that the underlying parser, YamlDotNet, is responsible for this behavior.
YamlDotNet, which GitHub Actions appears to use for YAML parsing, has a version 5.3.0 released in 2018. Upgrading to the latest version (18.1.0) did not resolve the issue, as the bug is still present in that version. The problem may have been partially addressed by a 2020 patch (YamlDotNet#467), but the fix only covered the double-quoted form, as the official YAML test suite only tested rule 8.2.3 with a double-quoted string.
Rewritten by urgent.news; may contain errors — check the original.
Source: yossarian.net