Replies: 1 comment 1 reply
-
So the expression you need is something like this: yq '.data["config.json"] |= (@jsond | .currentVersion = "cat" | @json)' file.yaml Explanation:
Hope that's clear! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a config.yaml file with a json object within that I need to change a value during YQ task run in pipeline.
I want the key "currentVersion" to get it's value updated but for some reason I just can't access the "config.json" object and the task creates a new field at the end (see config.yaml example below, the last three rows).
In my pipeline.yaml I left some of the expressions I've tried to work with.
ChatGPT was unfortunately not of any help and the documentation on here didn't help.
Here follows some simplified code samples.
config.yaml:
pipeline.yaml:
and finally the YQ task itself:
Beta Was this translation helpful? Give feedback.
All reactions