'Azure pipeline is being triggered with modification in excluded folders

I have a multiproject repo with 2 projects. I have a pipeline in each one with the exclude path defined with the other project. Anytime I push a change on any file, both pipelines are being triggered.

.
├── README.md
└── project-1
    |── azure-pipelines-apis.yml
│   └── …
└── project-2
    |── azure-pipelines-ui.yml
    └── …
└── project-3
└── project-4

And here are the pipelines:

Project-1:

trigger:
  branches:
    include:
      - 'dev'
  paths:
    include:
      - 'project-1/*'
    exclude:
      - 'project-2/*'
      - 'project-3/*'
      - 'project-4/*'
      - 'README.md'

Project-2:

trigger:
  branches:
    include:
      - 'dev'
  paths:
    include:
      - 'project-2/*'
    exclude:
      - 'project-1/*'
      - 'project-3/*'
      - 'project-4/*'
      - 'README.md'

Anytime I push a change in a file inside project-1, both pipelines run. I tried to define the include and exclude paths inside the triggers menu on Azure Devops Pipelines but didn't work.

Could you give me any clue to find what's going on? I've followed the official documentation but I can't find what is happening.

Thanks!



Solution 1:[1]

Your YAML triggers seem fine. You don't need to add the exclude part also since they are different paths. Could you please check the assigned YAML file on the Azure DevOps?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kazim Okan Akgül