How can I run a scheduled pipeline on a changing branch?

Update Scheduled Pipelines for a Changing Branch

Scheduled Pipelines can be created and updated to run on a specific branch via the CircleCI API:

curl --location --request PATCH "{schedule-id}" \
--header "circle-token: <PERSONAL_API_KEY>" \
--header "Content-Type: application/json" \
--data-raw '{
"name": "my schedule name",
"description": "some description",
"attribution-actor": "system",
"parameters": {
"branch": "<UPDATED_BRANCH>"
<additional pipeline parameters can be added here>
"timetable": {
"per-hour": 3,
"hours-of-day": [1,15],
"days-of-week": ["MON", "WED"]


Using another scheduled pipeline, you can query the project via API (on GitHub, you can use the list branches API) to get the latest/desired branch to run the scheduled pipeline on. Once the scheduled trigger is run, it will then be updated to the latest version for the next time it runs. The format should look like the following:

  1. Create a secondary scheduled pipeline to manage the changing pipeline
  2. Using the VCS API and the CircleCI API, update the changing scheduled pipeline as frequently as desired
Was this article helpful?
0 out of 0 found this helpful



Article is closed for comments.