Explore + Share Site

TIL: GitHub Actions accepts invalid YAML

“TL;DR: GitHub Actions accepts several invalid YAML productions, making it difficult (read: impossible) to parse some real-world action and workflow definitions with a properly conforming YAML parser.”

Jump to Highlight ↗
📖 Curated Deep Read Preview 175 words · ~1 min read

This is related to zizmor#1116, which has been bugging me for a year and a half.

Last April, a user reported that zizmor was rejecting a workflow containing a step that looks like this:

Apart from the use of a multi-line flow-style string for the json: key, nothing particularly stands out about this step.

Except: it isn't valid YAML! YAML says this about flow-style nodes that are nested inside of a block-style parent collection (read: map or array):

Flow nodes must be indented by at least one more space than the parent block collection. Note that flow nodes may begin on a following line.

YAML is a big and complicated spec, so it didn't even occur to me that this was invalid. Instead, I opened tree-sitter-yaml#36 to "fix" it. I've now opened tree-sitter-yaml#51 to revert that misbegotten fix.

On GitHub's side, I'm not sure if they have a clean path towards spec conformance here. Much of the code behind Actions is proprietary, but it seems likely that the underlying parser on their end is YamlDotNet.

Continue reading the full piece on yossarian.net ↗
Quick Use-Case Tags (tap to vote)
Visit Website ↗

📝 Your Private Notes & Highlights 🔒 Only visible to you

Log in or create a free account to keep private highlights and personal notes on your stored picks.

Creator Trophy & Press Kit

Featured on Storesso

Are you the creator of yossarian.net? Share your verified feature badge on your website, or export a custom 4:5 editorial social card for Instagram and X.

Verified Website Badge
Featured on Storesso
Claim Resource →
4:5 Social Studio

Generate a 1080×1350 vertical high-res feature card tailored for social sharing.

Instagram & X Feature Card

Export a polished, high-resolution 4:5 editorial graphic displaying your verified inclusion in the Storesso Discovery Index. Perfect for launch threads, founder updates, and newsletters.

Rendered at 1080×1350px (Retina ready) · No attribution watermark required.

Curated in These Public Collections

Discussion 0
🛡️ Safe comments: Text, Emojis & Reaction GIFs only (links & media URLs blocked)
✨ Author / Creator Quick-Reply No password required · Or Sign In