You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am setting up a github actions script which is in yaml format. Actions has a specific keyword set which relies on <key>: <value> syntax. See this page for all the keywords.
The on.push.branches event is basically described with the below yaml code:
name: GitHub CI
on:
push:
branches:
- master
tags: [ '**' ]
I am using version 1.6.1 of the editor which converts the on: key to the boolean true value as in the below result:
I did not check what github actions actually do with such a script, but my assumption is that keys are not supposed to be replaced by boolean values.
Am I missing something? I found a similar issue here but that is another tool and another context.
Or could it be that the yaml format used by Github is not actually compliant to either version of the standard and thus I should not try to use a yaml editor for such scripts?
The text was updated successfully, but these errors were encountered:
I tried out the formatting and had some odd result as you...
Problem description
The problem is, that under the hood snake-yaml parser is used to load the yaml document from string content into a yaml object and after this the object is dumped back to a string.
So we got String -> Yaml-Object ->String
"on" is recognized by snake-yaml as a boolean value... so inside the loaded yaml object its recognized as "boolean:true" and when doing the dump the output is switched to "true".
I have looked into the sources and found a potential solution: snake-yaml gives many possibilities to use specialized renderers and resolvers. Maybe for formatting there should customized variants which could avoid the problem.
- We use now a dedicated resolver to prevent boolean type conversion
when marshalling yaml content to objects for formatting.
- Per default prevention is enabled, but it can be turned off in
formatter preferences (if necessary)
- also behaviour of AbstractYamlEditorFoldingHandler was changed
so no longer NPE on startup possible
I am setting up a github actions script which is in yaml format. Actions has a specific keyword set which relies on
<key>: <value>
syntax. See this page for all the keywords.The on.push.branches event is basically described with the below yaml code:
I am using version 1.6.1 of the editor which converts the
on:
key to the booleantrue
value as in the below result:I did not check what github actions actually do with such a script, but my assumption is that keys are not supposed to be replaced by boolean values.
Am I missing something? I found a similar issue here but that is another tool and another context.
Or could it be that the yaml format used by Github is not actually compliant to either version of the standard and thus I should not try to use a yaml editor for such scripts?
The text was updated successfully, but these errors were encountered: