GitHub username (repo owner) check is too restrictive

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: