GitHub username (repo owner) check is too restrictive

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Environment:
      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}$"
      

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

              Created:
              Updated:
              Resolved: