Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger Azure Pipeline on every new push on any branch?

My current implementation of Azure pipelines is to trigger only when a pull request is made to Develop branch. But, I want to run the pipeline on every new push on any branch. How to trigger that?

My current implementation of the Azure YAML file

trigger:
  - none
pr:
  - branches:
      include:
        - dev

and below that steps are configured.

like image 555
artois Avatar asked Jan 29 '21 12:01

artois


People also ask

How do you auto trigger a pipeline in Azure DevOps?

Select trigger: Set the trigger that will start the deployment to this stage automatically. Select "Release" to deploy to the stage every time a new release is created. Use the "Stage" option to deploy after deployments to selected stages are successful. To allow only manual deployments, select "Manual".

How do you trigger a pipeline on a pull request Azure DevOps?

You can set up pull request triggers for both Azure Repos or GitHub repositories. From within your project, Select Pipelines > Releases, and then select your release pipeline. Under the Pull request trigger section, select the toggle button to enable it.


1 Answers

You need to specify the trigger something like this. So for example, if there is anything pushed in dev branch a build will get triggered. Ref

trigger:
- dev

or to be more explicit:

trigger:
  branches:
    include:
    - dev
    - another-branch

If no triggers are specified it will by default run for all branches. It can be explicitly defined as:

trigger:
  branches:
    include:
    - '*'
like image 83
Yogi Avatar answered Sep 23 '22 12:09

Yogi