Setting up a GitHub App
Setting up a GitHub App for use with SonarQube.
You need to use a GitHub App to connect SonarQube Server with a GitHub instance in order to be able to use the following features:
Importing your GitHub repositories into SonarQube Server.
Delegating the SonarQube Server user authentication to GitHub.
Autodetect AI code in projects using GitHub and GitHub Copilot.
You need the global Administer System permission in SonarQube Server to perform this setup.
Setup overview
The SonarQube Server uses the GitHub App to access GitHub resources as illustrated below. The GitHub resources access permissions are set in the App. A "GitHub Configuration" record is used in SonarQube Server to access the GitHub App. A different Configuration is used to manage the repository import and the user authentication.

Starting in Enterprise edition, you can set up the integration of SonarQube Server with multiple GitHub instances, each instance being accessed with a different GitHub App.
To set up a GitHub App to integrate SonarQube Server with GitHub:
Register a GitHub App for SonarQube Server.
Install the App on the organizations SonarQube Server needs to access.
Add the App to SonarQube Server’s global setup through a "GitHub Configuration" record. You must:
Create one GitHub Configuration for the GitHub repository import.
Create one GitHub Configuration for the user authentication delegation.
Step 1: Register a GitHub App for SonarQube Server
See GitHub’s documentation on registering a GitHub App for general information on GitHub Apps.
In the procedure below, we recommend registering a public App. You can register a private App if you have only one GitHub organization. In that case, you must register the App under that organization.
Specify the following settings in your app:
GitHub App Name: Your app’s name. Example: sonarqubeserver.
Homepage URL: Your SonarQube Server instance’s base URL (for information purposes only).
Callback URL: Your SonarQube Server instance’s base URL (the URL used to redirect to the SonarQube Server).
Webhook URL: To improve security, webhooks, by default, are not allowed to point to the SonarQube Server. Therefore, we recommend that you disable the feature unless you want to enable alerts for security issues in GitHub. See Setting up the report of security alerts for more information. To disable the feature, clear the Webhook Active checkbox to silence a forthcoming deprecation warning, and clear the Webhook URL and Webhook secret fields.
Under Permissions & events, set up the permissions and events as explained below. Some permissions or events are only necessary depending on the purpose of the integration.
Under Where can this GitHub App be installed? select Any account to make the App public in order to allow you in step 2 to install the App on any organization.
Step 2: Install the GitHub App for SonarQube Server in your organizations
You need to install the GitHub App for SonarQube Server on the GitHub organizations that SonarQube Server will need to access. See GitHub’s documentation on installing GitHub Apps for more information.
Step 3: Add the GitHub App to SonarQube Server’s global setup
You need to create a GitHub Configuration record in SonarQube Server and add the GitHub App to it. The setup is different depending on your integration purpose:
Last updated
Was this helpful?