I am using jq lib in GitLab to parse deployment info from dynamic JSON to determine if deployments should be made. I am not able to get jq any(condition)
working with dynamic attributes:
jq 'any(.name == "$my_value")'
Above returns always false, I've assigned a value dolle
into my_value
. If however, I run the same code like so, it returns true (as it should):
jq 'any(.name == "dolle")'
Here the json array that I give to jq:
[{ "name": "dolle" }, { "name": "polle" }]
What am I doing wrong?