skip to Main Content

I have pipelines.yml file in main branch, whenever there is a change in main branch the pipeline executes without any issues but not for other branches.

It is also working, when I placed the same pipelines.yml copy in other branches as well.
How to avoid keeping same file each branch and trigger whenever there is a change in other branches too.

trigger:
  batch: true

  branches:
    include:
    - main
    - dev
  
  paths:
    include:
    - tfroot/env/*/numbers.txt

Edit: I am not sure, what is the mistake I am making in yaml pipeline. It is working as expected in classic pipeline, but not in yml.
classic pipeline trigger
Working CI

Not-Working pipeline
Yaml pipeline not trigger

I also tried exporting the classic pipeline as YAML and pasted in other pipeline,the result not changed.

2

Answers


  1. you may try using template for the branch naming (Wildcards), linke: - branch*

    or override your yaml definition:

    enter image description here

    enter image description here

    Login or Signup to reply.
  2. Each branch should contain the yaml file to run your pipeline. Check the documentation:
    Branch consideration for triggers in YAML pipelines.

    To avoid this, you may use:

    1. Classic pipelines (as you mentioned).
    2. Use templates. Create a template repository and reference it in your local build yaml. In this case, the local yaml does not have any steps… all your steps are described in the template repo: Template types & usage
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search