Drone

Yaml parse bug conversion extension

When a conversion extension is used and it returns YAML that begins with “—\n# a comment” the parsing fails.

This does not appear to be an issue when using a .drone.yml file directly.

The parse error returned: yaml: missing kind attribute.

I have verified that the returned data does have the kind key. Further, removing the starting “—” fixes the issue. Ideally, parsing should be the same and a leading “—” should not cause parse issues.

Can you provide samples that can be used to reproduce. One issue I see is your code snippet uses an em dash (—) instead of a regular dash (-). A leading em dash would result in a parsing error.

Shoots. That’s macOS doing it’s thing in the browser. It is three standard dashes and the YAML is valid. Any YAML with the starting dashes should trigger it.

Shoots. Turns out my test yaml had a leading newline. Removing that fixes things.

Glad to see that you found the solution @brandonkal. I’ve had the same issue with newline in a yaml file when working in MacOS or Linux. Though, using VSCode has solved the ‘newline’ issue for me.