2
votes

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/*
1
I don't see the string .item anywhere in that code.Nick.McDermaid
@Nick.McDermaid - All the items inside Serialization.Master are items file onlysumit tandon
Have a think about that...... that's not your stated requirement. Might this be a bug in waiting?Nick.McDermaid

1 Answers

0
votes

Azure build pipeline path filter to only include particular file extension

If want to use path filter to trigger the build for those particular file-extension files in the folder Serialization.Master, you could use following syntax:

trigger:
  paths:
    exclude:
    - src/Foundation/*
    include:
    - src/Project/tds/Serialization.Master/*

You could check the document YAML schema reference for some more details.

Note: Do not forget the keyword paths.