You can essentially just define a variable:
variables: - name: isMaster value: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
and then say you want to run a stage when upstream dependencies are successful and it’s in the master/main branch:
- stage: AwsDev displayName: "AWS Development" dependsOn: ["Build"] condition: "and(succeeded(), eq(variables.isMaster, true))"
To contact me, send an email anytime or leave a comment below.