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

Repository Matching does not account for usernames other than `git`

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • github-plugin
    • None

      This is similar to, but distinct from https://issues.jenkins.io/browse/JENKINS-60612

      Specifically, for github enterpise accounts (hosted by github) the username is not `git` but rather something like `org-3722283` – as such the list of regex defined no longer match as they assume a username of `git@`.

      https://github.com/jenkinsci/github-plugin/commit/961b1e391bc8dfbb1670e285dce8413d8c3c9288

      This can be verified by watching the logs, which will now show the message

      ```
      Could not match URL org-3722283@github.com:/organizationName/repoName.git
      ```


      One workaround I can suggest in the meantime, is to set up the SCM with a Repository URL that omits the username entirely, and rely on the username from the credentials:

      The RepositoryURL in the SCM configuration for the above can be set as
      ```
      ssh://github.com/organizationName/repoName.git
      ```

      Setting the credential as an ssh key with username `org-3722283` will correctly work for fetching, and it will allow the regex that omits the username to match. Took me a bit to find a regex that matches though, so this is meant to save someone else some time

            lanwen Kirill Merkushev
            jansichermann Jan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: