2
votes

In Azure DevOps its possible to define build pipelines which by default is executed when a code is pushed to a branch.

I want the pipeline to run for all branches except one. The configuration

trigger:
  branches:
    include:
    - branchToInclude
    exclude:
    - branchToExclude

works when I push to branchToInclude.

But if I take away the include part the pipeline is not executed when I push to branchToInclude.

trigger:
  branches:
    exclude:
    - branchToExclude

A * instead of branchToInclude is not accepted when I try to save the file. Is there a way to configure a pipeline to execute for all branches except one?

1
What do you mean "pipeline is not executed", when you push code from any branch (not the exclude) the build not get running?Shayki Abramczyk
Yes, I changed the text to make it clearerUlrik

1 Answers

8
votes

I suppose something like this should work

trigger:
  branches:
    include:
    - '*'
    exclude:
    - branchToExclude