Yaml-Pipeline starts on every commit even though it should only be triggered on schedule

Viewed 818

I have an Azure Devops- pipeline that should be run each day at 3:00 on the develop - Branch. The start of the Yaml looks like this:

schedules:
- cron: "0 3 * * *"
  displayName: 3 build
  branches:
    include:
    - develop
  
pool:
  name: default
  demands: Agent.OS -equals Windows_NT
steps: 
...

Now my problem is: Whenever I push changes to ANY branch the pipeline starts to run ("Individual CI for ") so not only the cron is ignored, also the branchfilter seems to be ignored.

I have no overridden Trigger setup in the DevOps - UI.

What went wrong?

(there are no branch-policies that trigger this pipeline)

1 Answers

If you don't specify a set of triggers then Azure DevOps assumes that you want triggers on everything.

so not having a trigger section is the same as writing

trigger:
  branches:
    include:
    - '*'

If you don't want any triggers then you need to add the following to your pipeline

trigger: none 

This will explicitly tell Azure DevOps that you do not want to run the pipeline when a branch changes.

Related