Home > Software design >  How to nest yaml variable expressions?
How to nest yaml variable expressions?

Time:04-24

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 }},' ','.')}}"

CodePudding user response:

You have extra brackets around variables.projectName that should not be there:

- script: echo "projectKey2 is ${{ replace(variables.projectName,' ','.') }}"
  • Related