jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-50832] PollSCM triggers jobs even if there are no changes jenkinsfile declarative

Open
#1,181 4 comments 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin imported-jira-issue pipeline priority:blocker resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

 I'm using the github organization folder plugin to discover branches and pull requests dynamically. The discovery of new branches work as expected, but I want to reduce the time of discovering of new PR's and new commits for the specific repositories(by default is 1 day). For that I defined triggers { pollSCM('H/10 * * * *')} in the jenkinsfile(declarative) for some branches in some repos. I'm behind a firewall, so webhooks are not an option. However, the job triggers every 10 minutes in all the branches and PR's(until accepted) even if there are no changes after building once(it saves the trigger definition).

According to the triggers documentation, it should run only if there are changes.

I'm using this because GitSCM is not supported in the trigger definition. It would be super nice to have it in fact.

 

Any ideas in how to deal with this would be great/

---
Originally reported by clvx, imported from: PollSCM triggers jobs even if there are no changes jenkinsfile declarative


  • status: Open
  • priority: Blocker
  • component(s): github-branch-source-plugin
  • label(s): declarative, github-plugin, jenkinsfile, pipeline, pollscm
  • resolution: Unresolved
  • votes: 4
  • watchers: 6
  • imported: 2025-12-02

Raw content of original issue

 I'm using the github organization folder plugin to discover branches and pull requests dynamically. The discovery of new branches work as expected, but I want to reduce the time of discovering of new PR's and new commits for the specific repositories(by default is 1 day). For that I defined triggers { pollSCM('H/10 * * * *')} in the jenkinsfile(declarative) for some branches in some repos. I'm behind a firewall, so webhooks are not an option. However, the job triggers every 10 minutes in all the branches and PR's(until accepted) even if there are no changes after building once(it saves the trigger definition).

According to the triggers documentation, it should run only if there are changes.

I'm using this because GitSCM is not supported in the trigger definition. It would be super nice to have it in fact.

 

Any ideas in how to deal with this would be great/

environment

```
- Jenkins ver. 2.60.3

- Pipeline Plugin 1.2.7

- Pipeline: Multibranch 2.6

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.