diff --git a/Jenkinsfile b/Jenkinsfile index 4d7c31858..f838d0e53 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,8 @@ #!/usr/bin/env groovy +// Do not rebuild daily if not on the principal branch (e.g. not on PR, not on other branches, not on tags) +String cronPattern = env.BRANCH_IS_PRIMARY ? '@daily' : '' + pipeline { agent { // 'docker' is the (legacy) label used on ci.jenkins.io for "Docker Linux AMD64" while 'linux-amd64-docker' is the label used on infra.ci.jenkins.io @@ -11,7 +14,7 @@ pipeline { timestamps() } triggers { - cron('@daily') + cron(cronPattern) } stages {