Scheduling runs for latest release branch in Azure DevOps Pipelines

Viewed 23

I'm trying to schedule runs for our latest release branch. Is there any way of doing that except by updating the yaml file after every release?

I'm using this YAML right now, but it will schedule runs for ALL branches that starts with releases/*. Obviously I could replace this with the release number every time we release, but I want to avoid the hassle if possible.

schedules:
- cron: "0 4 * * *"
  displayName: Daily Production Copy
  branches:
    include:
    - releases/*
  always: true

Microsoft uses this code in their examples, but I don't understand the ancient. When are you supposed to change branch names from releases/* to releases/ancient/* like that? I see no easy way of moving branches to new folders in DevOps to make that happen.

schedules:
- cron: "0 0 * * *"
  displayName: Daily midnight build
  branches:
    include:
    - main
    - releases/*
    exclude:
    - releases/ancient/*
- cron: "0 12 * * 0"
  displayName: Weekly Sunday build
  branches:
    include:
    - releases/*
  always: true

to have a yaml pipeline trigger

0 Answers
Related