We are trying out Azure Pipelines CI with a GitHub project now that it is available in the marketplace. I've noticed that it doesn't seem to build branches besides master. Their documentation states that if a trigger section is specified in azure-pipelines.yml that you can configure it to only build specific branches, but that if trigger is not specified that it should be triggering off of all branches.
When I make changes to other branches besides master they do not trigger a build. Anybody know why, or is this a bug?
How did you set in your azure-pipelines.yml file?
Test with GitHub follow the sample mentioned here : Continuous integration (CI) and everything works as expected.
e.g,:
name: My Cool Build
trigger:
It will trigger the build once changes applied to any branch...
I agree that the examples are not clear. Try this example and it should work to build ALL branches:
trigger:
branches:
include:
- refs/heads/*
Try
trigger:
branches:
include: ['*']
As reported in the comments in the docs here (not the docs themselves obvs)
Related
trigger:
branches:
include:
- master
tags:
include:
- Showcase
pr:
branches:
include:
- master
the code above is from my yaml azure pipeline with using bitbucket repo. Anytime I do a PR in my bitbucket repository I expect build pipeline to run automatically in azure devops but it's not the case. Currently, I have to run the pipeline manually to complete PR validation. creating pipeline with the same line of code under another repo works correctly. I'm not sure what the problem is.
I created anoter dummy pipeline with a new project, the pr triggered build automatically when pr to the the master. the webhohook seems to be working fine. the trigger option doesn't override the yaml pipeline. I can't think of anything else to check.
I have my repos hosted on GitHub and running the pipeline on Azure DevOps, it is an iOS pipeline and I am not getting any error but while I try to raise a PR GitHub always gives a warning that I have conflicts and I have to make changes in the main branch as well, which I don't want to do since it might break the workflow is there any work-around for raising the pr without getting the conflict warning?
This is my YAML file:
pool:
vmImage: macOS-latest
trigger:
batch: true
branches:
include:
- develop
- epic/*
# trigger on PR builds targeting any branches
pr:
autoCancel: true
branches:
include: ['*']
# Adding parameters to Run UI
parameters:
- name: FIID
displayName: FIID
type: string
default: 00516
values:
- 00516
- 00031
This is the kind of conflict I am getting, I don't know what I might be doing wrong but I don't want to make changes in the develop branch everytime I have to raise a PR for xcodepipeline
If anyone could help me out that would be much appreciated, thanks.
Merge develop into your feature branch, fix the conflicts, push the changes. The PR should work like a charm after that.
This link should be useful https://akshayranganath.github.io/Git-Pull-Handling-Merge-Conflict/
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
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
To solve this issue, you could copy the same yaml file from other branches to all release branches.
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
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!
I'd like to push the build status automatically from Azure Devops to the github repository, so that pull requests can check for a build success before they can be merged.
I realise this can be done writing some custom code and calling the github status api, but there is a checkbox for it in the edit pipeline stage. It doesn't seem to work with Github though. See this image .
Other build tools like Bamboo have an out of the box plugin for doing this.
You need to define branch policy. You can read about this on my blog. You need to selected existing pipeline here in GitHub settings:
and then when you make PR you will get this:
You need to correctly define trigger options in your yaml file. For isntance:
this will run for all non master branch (with each commit pushed to GitHub pipeline will run)
for each merge to master will trigger pipeline too
trigger:
branches:
include:
- '*'
exclude:
- master
pr:
branches:
include:
- master
paths:
include:
- gated-checkin/*
exclude:
- gated-checkin/azure-pipelines.yml
I'm hoping to somehow replicate the functionality of PR triggers which, according to the docs, are currently only supported for GitHub and Bitbucket Cloud repos. I'd like my CI pipelines to not trigger if the change is incoming from certain branches.
I've mostly tried to solve this problem with GitVersion, which is the part of my pipeline that makes it problematic to trigger builds when I'm merging back from a release build or master back onto develop. So far I've had no luck, so now I'm hoping I've overlooked a feature of Azure Pipelines which will help.
My current pipeline trigger:
trigger:
batch: true
branches:
include:
- develop
paths:
exclude:
- ReadMe.md
- development-pipeline.yml
- release-pipeline.yml
- GitVersion.yml
I'd like a pull request which originated in a release branch (can be identified with the regex pattern [Rr]eleases?[\/-]) or master to not trigger my pipeline. In reality, any change to the develop branch triggers the build.
If you just want the develop branch not to trigger ci build, then you can check "Enable continuous integration" option in the Continuous integration of builds Triggers and set exclude develop branch in the branch filters.
If you want some source branches to trigger the CI build of the develop branch, some can't. I am afraid that this feature you want is not achievable. Once your deveop branch
Enable continuous integration, then the deveop branch will trigger the build pipeline once it changes.
If you want to merge the commits on the release or master branch into the develop branch, and create pr does not trigger the CI build, you could enable the build policy in the Build validation in the branch policy.In this way, only after PR is completed will CI build be triggered.But pr build is unavoidable.