circleci-docs
circleci-docs copied to clipboard
Scheduled Pipelines: can we continue to use regex branch filtering
Missing Information
Scheduled pipelines, there is nothing stated about or examples of regex branch filters.
Already Looked
https://circleci.com/blog/using-scheduled-pipelines/ https://circleci.com/docs/2.0/scheduled-pipelines/
Potential Locations
https://circleci.com/docs/2.0/scheduled-pipelines/
Thank you, @GaxZE -- we'll work on adding an example for this soon, but in the meantime here's how you'd do it for scheduled pipelines:
- Use a
whenclause for the workflows in question, with amatcheslogic statement against thepipeline.git.branchorpipeline.git.tagpipeline value - If you want this to apply to just scheduled pipelines, you could do the regex match in conjunction with a check of the
pipeline.trigger_sourcepipeline value (where the value can bewebhook,api, orscheduled_pipeline).
@kbatuigas this is not working, triggering tags is v1.0.1 and the regex should match
version: 2.1
[...]
workflows:
[...]
production:
when:
matches:
pattern: /v[0-9]+(\.[0-9]+)*([^-])*$/
value: << pipeline.git.tag >>
jobs:
- job_1
- job_2
Outcome:

I've read that each jobs needs to have the tag filter for them to be executed, this is not specified in the doc where you mentioned conditional workflow using when clause and is really counter intuitive when it's working fine for branches. this is mentioned deep in the doc but not in the workflow section.
CircleCI does not run workflows for tags unless you explicitly specify tag filters. Additionally, if a job requires any other jobs (directly or indirectly), you must specify tag filters for those jobs.
For instance another user being frustrated with this: https://discuss.circleci.com/t/use-of-pipeline-git-tag-in-workflows-name-when/36159/3
Hi @Maxwell2022 , thank you for the details - our engineers are helping to further investigate and we'll update this thread when we have more info.
Also, once you add these filters to all the jobs, the breadcrumbs in the dashboard are broken because the workflow is not triggered by a branch

Hello World, yes of course.
I should've actually fully read the page. https://circleci.com/docs/scheduled-pipelines#faq
Q: Do you support regex?
A: Not currently. Scheduled pipelines require highly deterministic inputs such as a commit SHA, branch, or tag (fully qualified, no regexes) included in the webhook, API call, or schedule.
I should've actually fully read the page. https://circleci.com/docs/scheduled-pipelines#faq
Q: Do you support regex? A: Not currently. Scheduled pipelines require highly deterministic inputs such as a commit SHA, branch, or tag (fully qualified, no regexes) included in the webhook, API call, or schedule.
Hi @GaxZE - no worries, that was actually only confirmed and added to the docs after you opened the issue and my initial response to you.
Hi @Maxwell2022 - thank you for bringing that to our attention; we have since added that information to the Workflows documentation.
With regards to the breadcrumbs, we've filed an internal ticket with our team who works on the CirceCI web UI. Thanks!