azure-devopsyamlazure-pipelinesazure-yaml-pipelines

Is it possible to Update the Build Definition name using YAML in Azure Pipelines


I am trying to update Build definition name based on the YAML runtime parameters. I am able to achieve this like below

name: ${{ parameters.source }} to ${{ parameters.target }} $(Date:yyyyMMdd).$(Rev:r)

But I want to update the build name by providing conditional expressions. Please let me know if this can be achieved.


Solution

  • You can do something like this

    ${{ if eq(variables['Build.SourceBranchName'], 'master') }}: stageName: prod

    Follow this link for full list of expressions you can use.