Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65240

Support branch filtering for Github webhooks

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • github-plugin
    • None
    • Jenkins: 2.277.1
      OS: Linux - 4.14.209-160.335.amzn2.x86_64
      ---
      github-branch-source:2.10.2
      github:1.33.1
      github-api:1.123
      git:4.7.0
      scm-api:2.6.4

      Currently, when a GitHub webhook is used to trigger builds, pushes to any branch will result in the job triggering.

      While a branch specifier limits which branch is built, there seems to be two issues:

      • It seems that you cannot avoid the initial build of the branch
      • There seems to be issues with change detection where a branch is always seen as "changed". This is particularly problematic with ephemeral workspaces (k8s pods) and wildcard branch specifiers.
      • When specifying a wildcard branch specifier, all matching branches are built. Combined with the change detection issue, this can result in repeated branch builds with no changes

      This behavior can be confusing and result in unexpected behavior as seen in JENKINS-42161.

      A seemingly simple solution would be to add branch filtering similar to what is available with the Gitlab plugin.

      Branch filtering would ensure that the job is only triggered for intended branches when there are actual events on that branch and would avoid the first build problem.

            lanwen Kirill Merkushev
            jalaziz Jameel Al-Aziz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: