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

GitHub username (repo owner) check is too restrictive

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • github-branch-source-plugin 2.0.5

      Problem

      The regex

      "^[0-9A-Za-z]([0-9A-Za-z._-]+[0-9A-Za-z])$"
      

      that is used inĀ GitHubSCMSource is too restrictive. It doesn't allow one or two character names.

      The check is for example used in PushGHEventSubscriber and silently prevents the triggering of Multibranch jobs.

      Proposed Fix

      A new regex should allow GitHub usernames like:

      • a
      • ab
      • a-b
      • a-b-c

      And disallow usernames like:

      • -
      • -a
      • a-
      • a--b

      Replace the existing regex with the following:

      "^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$"
      

            Unassigned Unassigned
            marbec Mark J. Becker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: