Home > Software engineering >  How to exclude everything that is not in the include - Azure DevOps YAML Pipeline
How to exclude everything that is not in the include - Azure DevOps YAML Pipeline

Time:12-01

If I have a trigger that looks like this:

trigger:
  branches:
    include:
      - main
  paths:
    include:
      - abc/def/*

Is everything that is NOT in that path automatically excluded? If not, how can I exclude everything that is not in that path abc/def/*?

CodePudding user response:

According to your YAML trigger file, it should be excluded everything that is not in the include path. It is equivalent to exclude *.

You can specify file paths to include or exclude in the YAML file.

When you specify paths, you must explicitly specify branches to trigger on. You can't trigger a pipeline with only a path filter; you must also have a branch filter, and the changed files that match the path filter must be from a branch that matches the branch filter.

For more information, you could refer to Paths in YAML Trigger.

  • Related