Azure Pipelines useful conditions
For my own reference as much as anything, here's a few Azure Pipelines conditions I've found useful:
Only run this task when building master
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
Only run this task when building a pull request branch
condition: contains(variables['Build.SourceBranch'], 'refs/pull/')
Only run this task when System.Debug variable has been set
condition: eq(variables['System.Debug'], 'true')
If I come across others, I'll update this post with them.
Categories: Azure Pipelines