Closed kftsehk closed 2 years ago
I appreciate the frustration. Unfortunately, this is a flaw in the underlying YAML language specification, not something that yq has any control over. We rely on PyYAML to interpret the language for us.
Luckily, YAML 1.2 eliminates this unintuitive behavior and treats on
like any other string literal. Unfortunately, PyYAML does not support YAML 1.2 and progress in implementing it has been very slow (I opened https://github.com/yaml/pyyaml/issues/116 almost 5 years ago and while a PR appeared about a year ago, it has not seen progress since).
PyYAML's most suitable competitor in this space, ruamel.yaml, does support YAML 1.2 but has its own issues and we currently have no plans to switch to it.
Thanks for explaining, the good side is there is a workaround.
v3.0.1 enables YAML 1.2 support, so this issue should now be fixed.
happens in github action yaml
test.yaml:
test case:
the output is not equivalent to
on: push
, in my opinion,on
totrue
transform should only be applied to values, not keysCurrent workaround is