jenkinsci / jenkinsci/git-plugin

[JENKINS-69146] GITScm polling starts jobs for PR builds despite specified branch

Open
#3,737 2 comments 0 reactions 0 assignees View on GitHub
component:git-plugin component:github-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

I'm experiencing a weird issue with GitHub Plugin when using the GitHub hook trigger for GITScm polling functionality. Specifically, I have a job which is supposed to run on each commit for our master branch(which is configured in the Branches to build field of the SCM section), but instead it gets triggered for pushes to any and all branches, despite the Job being configured clearly only for master.

The interesting part, is that when I look at the Polling Log I see:

[poll] Latest remote head revision on refs/heads/master is: ABC - already built by 13

Done. Took 1 sec

Changes found

As it states, it clearly sees that the master branch commit ABC has already been built by job 13, and yet, it then says that Changes found, and starts a #14 master branch build for the same commit that already was built. And when I do check the Changes section, it's empty:

This behavior makes no sense.

This isn't something I've seen with other builds using the GITScm polling function, and I'm speculating, but I think the issue is due to also a Multibranch pipeline existing for the same repository, and the GitHub Webhook being configured like this:

I'm not sure though.

---
Originally reported by always_fail, imported from: GITScm polling starts jobs for PR builds despite specified branch


  • status: Open
  • priority: Major
  • component(s): git-plugin, github-plugin
  • label(s): github, polling, polling-scm, scm, webhook
  • resolution: Unresolved
  • votes: 2
  • watchers: 3
  • imported: 2025-12-02

Raw content of original issue

I'm experiencing a weird issue with GitHub Plugin when using the GitHub hook trigger for GITScm polling functionality. Specifically, I have a job which is supposed to run on each commit for our master branch(which is configured in the Branches to build field of the SCM section), but instead it gets triggered for pushes to any and all branches, despite the Job being configured clearly only for master.

The interesting part, is that when I look at the Polling Log I see:

[poll] Latest remote head revision on refs/heads/master is: ABC - already built by 13
Done. Took 1 sec
Changes found

As it states, it clearly sees that the master branch commit ABC has already been built by job 13, and yet, it then says that Changes found, and starts a #14 master branch build for the same commit that already was built. And when I do check the Changes section, it's empty:

This behavior makes no sense.

This isn't something I've seen with other builds using the GITScm polling function, and I'm speculating, but I think the issue is due to also a Multibranch pipeline existing for the same repository, and the GitHub Webhook being configured like this:

I'm not sure though.

  • environment: 2.361

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.