i want to create pipeline that will show prod
stage only for release/
branches. I developed yaml like this:
trigger:
- main
pr:
- main
stages:
- template: templates/infra-terraform-deploy.yml@templates
parameters:
# parameters
- template: templates/infra-terraform-deploy.yml@templates
parameters:
# parameters
- ${{ if startsWith( variables['Build.SourceBranchName'], 'refs/heads/release' ) }}:
- template: templates/infra-terraform-deploy.yml@templates
parameters:
# parameters
But unfortunately, last stage is always not present in my pipeline.
How to construct yaml pipeline in Azure Devops that will show last stage only for branches that starts with release
?