artois
artois

Reputation: 575

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.

Upvotes: 31

Views: 46363

Answers (3)

Sebastian Inones
Sebastian Inones

Reputation: 1701

In my case, using Azure DevOps, I have this on my .yaml file:

trigger:
- '*'

So, it gets triggered no matter to which branch I'm pushing to. I hope it might help.

Upvotes: 5

Yogi
Yogi

Reputation: 9759

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:
    - '*'

Upvotes: 58

user14692794
user14692794

Reputation:

If you have git and a repo created in your project, you can easily connect git to azure dev ops. So let's say you want to deploy every push you give to the master branch of your repo. You can connect your master branch to the azure DevOps so it deploys it automatically.

This link will provide additional information

Upvotes: -1

Related Questions