My develop branch is protected, so you have to pull request to it. I tried to create a pipeline to build and run unit tests when I new pull request is created.
However, when I create a feature branch from develop and I push the changes for the feature branch, the pipeline is being trigged, even though I haven't created a pull request yet. The feature branch has the yaml file since is derived from develop.
Yaml file:
pr:
- develop
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
testSelector: testAssemblies
testAssemblyVer2: |
**\*unittests**.dll
!**\*TestAdapter.dll
!**\obj\**
What should I do to run the pipeline only when there's a pull request from feature branch to develop?


trigger: noneto the YAML file. - Toribio