0
votes

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

2
It may be similar issue to this one, stackoverflow.com/questions/59102880/… check my answer with overriding yaml example.Kontekst
You can find more information what could go wrong here: docs.microsoft.com/en-us/azure/devops/pipelines/repos/… Check case-sensitivity too.Kontekst
@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

2 Answers

0
votes

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

0
votes

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!