scheduled builds never trigger in azure devops pipeline

Viewed 2697

I have the following configuration in my open source project hosted on GitHub: https://github.com/wez/wezterm/blob/master/azure-pipelines.yml#L9

schedules:
- cron: "0 0 * * *"
  displayName: Daily build
  always: true
  branches:
    include:
- master

my azure org is https://dev.azure.com/wez0788/wezterm. My project is open source and using the free tier.

The schedule doesn't appear to have any effect; no scheduled build shows up in the list of builds.

The documentation for build triggers has a troubleshooting section that doesn't have any useful information on why a scheduled build wasn't scheduled. It's not even clear if the syntax is correct as there is no UI to indicate whether the pipeline has picked up the schedule. The config is sufficient that pushes to the repo and PRs do trigger successful builds.

This question sounds similar, but with the notable difference that I've never had a single scheduled build ever run, so it's not an intermittent problem: Azure DevOps build pipeline unreliable triggering by schedule

Someone else appears to be having the same problem and filed a GH issue over here, but since that was a doc issue tracker it got closed: https://github.com/MicrosoftDocs/vsts-docs/issues/4589

How can I get my scheduled build to actually run?

2 Answers

Try to Use the following just replace double quote " with the single quote '

schedules:
- cron: '0 0 * * *'
  displayName: Daily build
  branches:
    include:
    - master
  always: true

A contributor just provided a method, which I think might help you.When you first start building your pipeline with github repo, it will not trigger the schedule trigger. You need to modify the yaml file. After the modification, the schedule build should be triggered normally.

The second scenario is: there are two contributors that all use the repo on the same github to build the pipeline. One contributor's build pipeline can't trigger the schedule build, and another contributor's can trigger the schedule build normally. Their solution is: in the pipeline that can trigger the schedule build, run the schedule build again. At this time, the pipeline that can't trigger the schedule build also shows this running schedule build. After that, he can trigger the schedule build normally. So I suggest that you can try to build a pipeline with the same github repo in another project or organization. If the pipelien can trigger the schedule build normally, then you can use my method to restore the pipeline that cannot trigger the schedule build.

In addition, I think your yaml statement is no problem, I tested it with the same statement, it can trigger schedule build normally.

enter image description hereenter image description here

I suggest that you can set the trigger time to be shorter, which is convenient for testing.For example:This setting is to trigger the schedule build every minute. enter image description here

I also saw that you are here to discuss with contributors with the same problem, I will also continue to pay attention to this issue.

Hope this helps.

Related