'Disable trigger on branch changes in scheduled trigger
I try to specify in a yml file that a job should be run at 4 every morning if there are changes in the master branch.
The yml file starts like:
trigger: none
schedules:
- cron: '0 4 * * *'
displayName: Testing daily run
branches:
include:
- master
However, this is triggered upon every change of the master branch. Why?
Trying to list triggers in the UI
I got a suggestion that I could check if there is any trigger for the pipeline that could possibly override the yaml schedule.
If I edit the pipeline, there is a "Trigger issues" menu
resulting in an empty view
so I am still without a solution.
(The "scheduled runs" menu actually lists the next runs as expected, but adds a timezone offset of 2 hours)
Triggers listed when editing a pipeline
When clicking the Edit button in a pipeline, I get a menu like
and when I click triggers it seems like I have nothing that disturbs my yaml schedules, but I may be wrong, the checkbox "Override the YAML continuous integration trigger from here" is not checked. Maybe the list of disturbing triggers is empty (maybe not).
Solution 1:[1]
As per my commented suggestion, here's some screenshots of how to double check to see if you have any triggers set in the UI.
On the pipeline screen in your first screenshot, press edit to bring up the pipeline yaml. Within this click the 3 dots and select triggers
You should then see the CI triggers, and on the left a warning that anything you set will override the triggers in the yaml file
Solution 2:[2]
Disable trigger on branch changes in scheduled trigger
I checked your grammar and it should be correct, but I couldn't test it for a short period of time, so I simply changed the grammar to 2 minutes instead of 4 o'clock every day?
schedules:
- cron: "*/2 * * * *"
displayName: Testing daily run
branches:
include:
- master
You could also change it for test. And it works as expect.
Please check if the YAML is under the master branch.
And if it under the master branch, you could try to add the trigger from the UI to overwrite the YAML:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | DharmanBot |
Solution 2 | Leo Liu-MSFT |