fjogeleit / yaml-update-action

Update YAML property with dynamic values

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

propertyPath doesn't allow to access an array element

mogui opened this issue · comments

commented

Could you use something more robust than the custom implementaion, like JsonPath ?

export function replace<T extends YamlNode>(value: string | number | boolean, valuePath: string, content: YamlNode): T {

You can access array elements with .indexNumber like containers.0.image. Yes it is currently very basic. I will have a look on your suggestion.

See #155

commented

Oh thanks it works!
Yeah json path would be much more elagant, you can do smoething more complex like path.array[name=foo].bar

yeah, you're right, I will test it and see if it is backward compatible or how I can make it optional available. Don't want to break existing workflows.

The new release has jsonpath support. Thanks for the suggestion:

https://github.com/fjogeleit/yaml-update-action/releases/tag/v0.7.0

commented

Great!