如何嵌套yaml变量表达式?
我想将YAML变量表达式嵌套在Azure DevOps管道中,因为一个步骤使用了由空格隔开的项目名称,而另一个则使用“我的项目” vs'my.project'。
这就是我目前的目前
- script: echo "projectKey2 is ${{replace(${{ variables.projectName }},' ','.')}}"
I want to nest yaml variable expressions in a Azure Devops Pipeline as one step uses the project name separated by spaces and another uses periods ie 'My Project' vs 'My.Project'.
This is what I have currently but the echo is outputting 'My Project' instead of 'My.Project'
- script: echo "projectKey2 is ${{replace(${{ variables.projectName }},' ','.')}}"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在
variables.projectName
周围有额外的括号:You have extra brackets around
variables.projectName
that should not be there: