For GitHub Enterprise, the minimum version is 2.14
Creating a GitHub App
You can add Pull Request decoration under the GitHub Checks tab or Conversation tab. To do this, an instance administrator must first create a GitHub App:
- Follow Steps 1–4 here to start creating your GitHub App.
- Under GitHub App name, give your app a name (such as SonarQubePRChecks).
- GitHub requires a Homepage URL and a Webhook URL. These values aren't important for Pull Request decoration, so you can use any URL (such as
https://www.sonarqube.org/
). Grant access for the following Permissions
Permission | Access |
---|
Checks | Read & write |
GitHub Enterprise: Repository metadata GitHub.com: Metadata | Read-only |
Pull Requests | Read & write |
Commit statuses | Read-only |
- Under "Where can this GitHub App be installed?," select Any account.
- Click Create GitHub App. This will take you to your new GitHub App's page.
- Scroll down to the bottom of your app page and click Generate Private Key. This downloads a
.pem
file that you'll use in the Setting your global settings section.
Installing your app
Install your GitHub App from the app's settings page. See the GitHub instructions for more information.
Setting your global settings
To set your global settings in SonarQube, navigate to Administration > Configuration > General Settings > ALM Integrations and select the GitHub tab.
From here, set your Configuration Name, GitHub Instance URL, GitHub App ID, and your GitHub App's Private Key (that was generated above in the Creating a GitHub Appsection).
Note: Make sure the Configuration name is succinct and easily recognizable as it will be used at the project level to identify the correct ALM configuration.
Setting your project settings
Go to Project Settings > General Settings > Pull Request Decoration, select your Configuration Name, and set your Repository identifier.
By default, Enable analysis summary under the GitHub Conversation tab is on and your Pull Request analysis will be shown under the Conversation and Checks tabs in GitHub. Turning this setting off will make it so Pull Request analysis is only shown under the Checks tab.