Unwanted pipelines triggers

Viewed 54

I have next structure of my repo in Azure's VisualStudio:

development ↴
            - Branch1
            - Branch2

I have a pipeline.yaml in the development branch:

trigger:
  - development

pool:
  vmImage: ubuntu-latest

variables:
  - name: DEPLOYMENT
    value: development

jobs:
  - job: Print evironment
    steps:
      - script: printenv | sort

I have a pipeline linked to that file in development branch. Also I have a policy to run that pipeline for pull requests.

And I have two problems with this config.

  1. When I am pushing anything into ANY branch that has that pileline.yaml file - pipeline will be triggered for that branch. And that affects all the branches nested from development branch
  2. When I am creating a pull request - it is triggering the build. But if I am pushing changes to the branch then two builds are triggering. One for the branch itself and one for pull request.

What am I doing wrong?

1 Answers

So the problem was in trigger syntax

This is working as explained in the question:

trigger:
  - development

This is working as expected:

trigger:
  branches:
    include:
      - development
Related