Need to create a YAML based azure build pipeline i.e, need to run particular tasks like only build step when it is PR automated and when the same pipeline manually run it should run build task along with archive and publish artifact tasks

1 Answer 1


Yes; you can use the Build.Reason pre-defined variable in a task condition, like this for example:

condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.