0

I'm working for the first time with Azure Devops Pipelines. I'm using a .yml file. But I can't figure out why the pipeline won't run when I checkout and push a branch from develop to "releases/*. It just won't trigger even when there are changes in src/ which are inside my new releases/newbranch

But when I merge my change from "customers/feature-branch" with customers/moa-prototype-client1/release the pipeline will run.

My trigger is:

trigger:
  branches:
    include:
    - customers/moa-prototype-client1/release
    - releases/* 
  paths:
    include:
    - src/*
    - src/customers/moa-prototype-client1/*
    exclude:
    - '*.yml'
    - src/customers/*

What can cause this?

So in short: It will trigger when I merge from Customers/Customername/Develop to Customers/Customername/Release. But won't when I merge from Develop to Releases/*

Our repo:Gitflow

Mattyy
  • 23
  • 1
  • 6
  • It may be similar issue to this one, https://stackoverflow.com/questions/59102880/azure-devops-ci-pipeline-for-master-being-triggered-by-changes-in-branch-and-vic/59107351#59107351 check my answer with overriding yaml example. – Kontekst Jul 02 '20 at 13:22
  • 1
    You can find more information what could go wrong here: https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#faq Check case-sensitivity too. – Kontekst Jul 02 '20 at 13:30
  • @Kontekst thanks for your reply, It was an user error there was an "space" behind the trigger.. I think this was causing the problem. It all works fine now :) – Mattyy Jul 06 '20 at 09:09

2 Answers2

1

Solution: After checking the links and possible solution some users suggested, I got it to work. But I was not totaly happy whit this fix, because I wanted to run my pipeline though my .yml file and not override my triggers though the pipeline settings.

When I looked at my .yml again and noticed a space behind releases/*, I removed this space and committed this to my repo and all was working as it should!

Mattyy
  • 23
  • 1
  • 6
0

From your description, it seems that this issue exists in the Release/* branch. And the customers branch could work as expected.

During my testing, I encounter a similar situation. If the Release/* branch doesn't contain the Yaml file with triggers, the changes in the release branches will not trigger the build.

For example:

Doesn't work

No Yaml file

To solve this issue, you could copy the same yaml file from other branches to all release branches.

Contain Yaml file

Then the changes in the Release branches could trigger the build successfully.

On the other hand, as Kontekst said, the Path filters are case-sensitive. You could check them at the same time.

Hope this helps

Kevin Lu-MSFT
  • 20,786
  • 3
  • 19
  • 28
  • Thanks for your reply, the yml file is available in every branch. I this case it was an user error.. some how there was a space behind my trigger. now everything is working fine :) – Mattyy Jul 06 '20 at 09:07