Azure build pipeline path filter to only include particular file extension
02:04 28 Aug 2020

I'm working on creating build pipeline in Azure DevOps. I want to trigger it against master branch but only when commit has changes under src/Project/tds/Serialization.Master/ Project - this project contains only .item files If the commit includes any other files together with .item then this pipeline shouldn't trigger, tried path exclude

BDD

Scenario 1

Given | I've changes for src/Project/tds/Serialization.Master/*

Then | build pipeline should trigger

Scenario 2

Given | I've changes for src/Project/tds/Serialization.Master/*

And | I've changes for src/Foundation/*

Then | build pipeline shouldn't trigger

Scenario 3

Given | I've changes for src/Foundation/*

Then | build pipeline shouldn't trigger

trigger:
  branches:
   include:
     - master
  paths:
    include:
      - src/Project/tds/Serialization.Master/*
    exclude:
      - src/Foundation/*
azure-devops azure-pipelines azure-pipelines-yaml azure-pipelines-build-task