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

Scanning private repos of GitHub user accounts with GitHub App credentials fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Labels:
    • Environment:
      GitHub API Plugin 1.112.0
      GitHub Branch Source Plugin 2.8.0
      GitHub Plugin 1.30.0

      Docker image jenkins/jenkins:lts
      DIGEST:sha256:83df661d1a2ad921323868ca48f432b175b039bb9e16be0209c0253f3186f25e
    • Similar Issues:

      Description

      In the “New Item“ view, the description for the plugin is as follows:

      Scans a GitHub organization (or user account) for all repositories […]

      However, private repositories belonging to GitHub user accounts are not found if GitHub App credentials are used. The scan only works using personal access tokens or password authentication.

        Attachments

          Issue Links

            Activity

            Hide
            sergeiwaigant Sergei Waigant added a comment -

            We have the exact same situation when using GitHub Enterprise 2.20+

            The GitHub App Credentials in Jenkins are not usable for private repositories.

            Stack Trace attached which is coming when selecting the GitHub App credentials in a multi branch pipeline job.
            private-repo-stacktrace.txt

             

            Show
            sergeiwaigant Sergei Waigant added a comment - We have the exact same situation when using GitHub Enterprise 2.20+ The GitHub App Credentials in Jenkins are not usable for private repositories. Stack Trace attached which is coming when selecting the GitHub App credentials in a multi branch pipeline job. private-repo-stacktrace.txt  
            Hide
            gaikanomer9 Nikita Zavyalov added a comment -

            I can also confirm the bug. We are using GitHub Enterprise as well.

            I used the secret from the GitHub App to manually make connections to GitHub API and it was able to retrieve internal repositories. When using the same secret with the plugin it can only find the public repos.

            Tested on the latest version and 2.7.1

            Show
            gaikanomer9 Nikita Zavyalov added a comment - I can also confirm the bug. We are using GitHub Enterprise as well. I used the secret from the GitHub App to manually make connections to GitHub API and it was able to retrieve internal repositories. When using the same secret with the plugin it can only find the public repos. Tested on the latest version and 2.7.1
            Hide
            sergeiwaigant Sergei Waigant added a comment -

            I was surprised that the private repositories were readable for another installation...
            Now I was running into same problem and the root cause was, that the app was installed into two different organisations.
            If you want to interact with a private repository, you need to set the "owner" in the GitHub App Credential in Jenkins to the particular organisation...

            I think that issue is related to https://issues.jenkins-ci.org/browse/JENKINS-62220

            We are on GitHub Branch Source 2.8.3

            Show
            sergeiwaigant Sergei Waigant added a comment - I was surprised that the private repositories were readable for another installation... Now I was running into same problem and the root cause was, that the app was installed into two different organisations. If you want to interact with a private repository, you need to set the "owner" in the GitHub App Credential in Jenkins to the particular organisation... I think that issue is related to  https://issues.jenkins-ci.org/browse/JENKINS-62220 We are on GitHub Branch Source 2.8.3
            Hide
            triangulumlabs Triangulum Labs added a comment -

            I also so have exact problems that Sascha Sadeghian is facing, any progress on this?

            Show
            triangulumlabs Triangulum Labs added a comment - I also so have exact problems that Sascha Sadeghian is facing, any progress on this?
            Hide
            llibicpep Dmytro Kryvenko added a comment -

            It seems like https://issues.jenkins.io/browse/JENKINS-62220 is the root cause for this issue.

            Also see my comment here for more details https://issues.jenkins.io/browse/JENKINS-34612?focusedCommentId=401331&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-401331

            I have filed a separate issue https://issues.jenkins.io/browse/JENKINS-64249 to fix documentation as it is confusing as it is right now.

            I am closing this issue as duplicate in favor for 62220 - lets focus discussion there.

            Show
            llibicpep Dmytro Kryvenko added a comment - It seems like https://issues.jenkins.io/browse/JENKINS-62220  is the root cause for this issue. Also see my comment here for more details https://issues.jenkins.io/browse/JENKINS-34612?focusedCommentId=401331&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-401331 I have filed a separate issue https://issues.jenkins.io/browse/JENKINS-64249  to fix documentation as it is confusing as it is right now. I am closing this issue as duplicate in favor for 62220 - lets focus discussion there.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              sadeghian Sascha Sadeghian
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: