I have a scheduled build set up to run overnight for all my applications. I'm currently defining multibranch pipeline jobs using the Jenkins Job DSL to leverage the benefits of being able to run branch builds. However, I would like to prevent the scheduled build to happen for the branch builds (all the branches different to main/master).
I have searched both through the documentation in <my-jenkins-location>/plugin/job-dsl/api-viewer/index.html
and through the manual settings menus for the multibranch pipeline job but couldn't find any setup that would aallow me to do so.
I decided to have a function in my pipelines which checks whether the build being run is from a branch different than main and skip all stages in case it is, but this is not ideal since the build is actually happening. I would like it to not be even triggered by the timer. Is it possible to achieve this?