I have a pipeline which I want to trigger when PR is merged into master
. I have tried different things, but this did not work. Furthermore, I am neither getting any error nor pipeline is triggering.
I do not want this to be triggered on PR creation. I want this to be triggered when PR is merged into master
. That is the reason I have not added pr
in my yml
.
What am I missing here?
Approaches:
- Enabled "Continuous Integration" option
- Following
trigger
syntax per Microsoft recommendation
trigger:
batch: True
branches:
include:
- master
paths:
include:
- cosmos
Pipeline:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
batch: True
branches:
include:
- master
paths:
include:
- cosmos
stages:
- stage: SOME_PATH_dev
displayName: SOME_PATH_dev
jobs:
- deployment: 'DeployToDev'
environment: Dev
cancelTimeoutInMinutes: 1
pool:
vmImage: ubuntu-latest
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: AzureResourceGroupDeployment@2
displayName: Azure Deployment:Create Or Update Resource Group action on SOME_PATH_dev
inputs:
ConnectedServiceName: SOME_KEY
resourceGroupName: SOME_PATH_dev
location: West US
csmFile: cosmos/deploy.json
csmParametersFile: cosmos/parameters-dev.json
deploymentName: SOME_PATH.Cosmos.DEV
Repo Structure:
References:
- "Configuring the trigger failed, edit and save the pipeline again" with no noticeable error and no further details
- Azure Devops build pipeline: CI triggers not working on PR merge to master when PR set to none
- https://medium.com/@aksharsri/add-approval-gates-in-azure-devops-yaml-based-pipelines-a06d5b16b7f4
- https://erwinstaal.nl/posts/manual-approval-in-an-azure-devops-yaml-pipeline/