I am trying to write a pipeline to build an image and deploy to the test environment which is hosted on Azure. My codebase lies on GitHub. While trying to trigger the pipeline on a pull request from the source branch against the target branch, I am facing an issue where the pipeline doesn't trigger for the PR but runs fine for my other conditions, such as, push to develop or master.
The condition used for the PR trigger is as follows:
and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'), startsWith(variables['System.PullRequest.SourceBranch'], 'release/'), eq(variables['System.PullRequest.TargetBranch'], 'master'))
The triggers in the yaml file can be seen below:
trigger:
branches:
include:
- develop
- master
paths:
exclude:
- k8s/*
- src/VERSION
- src/package.json
pr:
- master
Am I missing something here?