Home > Mobile >  DevOps Pipeline runs whenever main branch changes, rather than on desired schedule
DevOps Pipeline runs whenever main branch changes, rather than on desired schedule

Time:11-07

I have the following DevOps pipeline:

schedules:
- cron: "0 6 * * Mon"
  displayName: Monday Morning World Build
  branches:
    include:
    - main

stages:
  - template: ./pipeline-review.yml

... other stuff that's probably not important

However, this pipeline automatically runs whenever the main branch changes. What I want is for this pipeline to only run every Monday at 6am. Anything else I need to do?

CodePudding user response:

Ok, I think I figured this out. By default, DevOps includes a CI/CD trigger on all branches. You need to disable this:

trigger: none

schedules:
- cron: "0 6 * * Mon"
  displayName: Monday Morning World Build
  branches:
    include:
    - main

It's annoying how absolutely no documentation or blog I found mentioned this. I guess everyone assumes you want CI/CD and the scheduled trigger.

  • Related