Azure pipeline wasn't triggered when the PR move from draft to open - github

am experiencing an issue with the Azure pipeline wasn't triggered when the PR moved from draft to open
Here is the yaml configuration I used:
trigger: none
pr:
drafts: false
branches:
include:
- main
- hotfix/*
does anyone has idea what is going wrong with it?

Related

pull request doesn't trigger build pipeline

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.

Azure DevOps Pull Request checker triggered by changes outside from included path

I have a PR checker triggered when someone creates a pull request in Github. My yml file is on GitHub and the pipeline is on Azure DevOps. So, here is my trigger:
PR check
pr:
branches:
include:
- main
paths:
include:
- src/Web
trigger: none
But, when someone makes changes in other directories that are not included in the path above, let's say in src/API or docs it triggers the pipeline and runs a build check. It's not supposed to be checked as I have another pipeline for it.
Can someone point out where the error is?

Triggers in Azure devops with many branches in repository

On a migration from gitlab to azure, we need to specify triggers. I have a pipeline on my main (azure-pipelines.yml) which describes the pipeline, I have a trigger condition
trigger:
- none
pr:
branches:
include:
- main
This is purely to make sure that after the merge to main has happened, the pipeline is triggered.
However, if I create any feature to this repo, I create a new branch ( featureX) from master and it will have the same azure-pipelines.yml file. On this branch, I would like the SW to be built for every commit I do to that branch ( featureX). So it makes sense to have the trigger in the branch ( featureX) as follows:
trigger:
branches:
include:
- '*'
Now when the merge is ready, is it a best practise to delete the pipeline file from the featureBranch or do we change the trigger in the yml file of featureBranch?
Or is it handled in a way which I did not mention here?
So you want to trigger a build for every PR and for any feature branches?
If I understand that correctly, keep a single azure-pipelines.yml file and just add a branch trigger:
trigger:
branches:
include:
- feature/*
pr:
branches:
include:
- main

PR trigger not working with Azure DevOps and GitHub

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/

Push Build status to GitHub

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