Let's have a file values.yaml:
container:
name: aaaa
file:
name: test.txt
Define an environment variable:
NEWNAME=bbbb
Make the replacement:
yq e ".container.name = \"$NEWNAME\"" values.yaml
Output:
container:
name: bbbb
file:
name: test.txt
For inline change - add -i to yq