1

I have enabled CI and set a pipeline trigger with on main and applied path filters for 2 folders A and B.

I want to create 2 agents jobs X and Y which runs tasks based on the trigger. Example: If the trigger is due to changes in folder A, then Agent X should run and if the trigger is due to changes in folder B, then Agent Y should run.

What exactly is the condition that should be kept in order to implement this scenario.

1 Answers1

0

in your situation, you can create two yaml files in the repo and create two pipeline based on them.

Jusk like below.

trigger:
  paths:
    include:
    - A/

pool:
  vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

And

trigger:
  paths:
    include:
    - B/

pool:
  vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'
Bowman Zhu-MSFT
  • 4,776
  • 1
  • 9
  • 10