Author : MD TAREQ HASSAN | Updated : 2022/01/06
About Trigger
- Trigger is setup to run a pipeline automatically
- We can configure a pipeline to run upon a push to a repository, at scheduled times, or upon the completion of another build
- Trigger types:
- CI trigger or Push trigger
- PR trigger or Pull request trigger
- Scheduled trigger
- Pipeline completion trigger
CI trigger with list of branch names
azure-pipelines.yml
trigger:
- main
- dev
- feature
CI trigger with complete control
azure-pipelines.yml
trigger:
batch: true
branches:
include:
- dev/*
- features/*
exclude:
- features/experimental/*
tags:
include:
- v2.*
exclude:
- v2.0
paths:
exclude:
- README.md
Disable CI trigger
First, disable “Override YAML continuous integration trigger”
- Pipelines > All > select the target pipeline
- Edit > Click on more options (virtical dots on top right) > Trigger
- Unheck “Override the YAML continuous integration trigger from here”
- Save
Now, disable CI trigger in yaml: azure-pipelines.yml
# A pipeline with no CI trigger
trigger: none
# ... ... ...
Notes:
- For multiple pipelines with multiple yaml files, repeat the process decribed above for all pipelines
- Add
trigger: none
to all yaml files
Links
- Trigger yaml schema: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#triggers
- Pipeline trigger - trigger one pipeline after another: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops
- PR trigger: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=example%2Cparameter-schema#pr-trigger
- Scheduled trigger: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=example%2Cparameter-schema#scheduled-trigger