Start Free
10.5 | DevOps platform integration | GitHub integration | Introduction

Introduction to GitHub integration

On this page

SonarQube's integration with GitHub Enterprise and GitHub.com allows you to maintain code quality and security in your GitHub repositories.

With this integration, you'll be able to:

  • Authenticate with GitHub: Sign in to SonarQube with your GitHub credentials.
  • Import your GitHub repositories: Import your GitHub repositories into SonarQube to easily set up SonarQube projects.
  • Analyze projects with GitHub Actions: Integrate analysis into your build pipeline. Starting in Developer Edition, SonarScanners running in GitHub Actions jobs can automatically detect branches or pull requests being built so you don't need to specifically pass them as parameters to the scanner.
  • Report your quality gate status to your branches and pull requests (starting in Developer Edition): See your quality gate and code metric results right in GitHub so you know if it's safe to merge your changes.
  • Display code scanning alerts for vulnerability issues in GitHub: Display security issues found by SonarQube as code scanning alerts in the GitHub interface: see below.
  • Manage your monorepos: Import your monorepo into SonarQube to easily manage the related projects.

Display of SonarQube security alerts in GitHub

Starting in Developer Edition, SonarQube can provide feedback about security issues inside the GitHub interface itself provided the corresponding GitHub repository has been imported into SonarQube. The security issues found by SonarQube will appear in both:

  • The SonarQube interface, as part of the displayed analysis results.
  • The GitHub interface, as code scanning alerts under the Security tab.

When you analyze a project in SonarQube, the detected security issues are displayed on the GitHub interface, under your repository's Security > Code scanning alerts tab. 

github code scanning alerts for sonarqube

When users change the status of a security issue in the SonarQube interface, that status change is immediately reflected in the GitHub interface. Similarly, if users change an alert status in GitHub, that change is reflected in SonarQube.

Initially, all issues marked Open on SonarQube are marked Open on GitHub. Because the available statuses on the two systems are not exactly the same, the following logic is used to manage the transitions.

In SonarQube, a transition to:Results in this On GitHub:
AcceptedDismiss: Won't Fix
False PositiveDismiss: False positive
OpenOpen
On Github, a transition to:   Results in this in SonarQube:
Dismiss: False positiveFalse Positive
Dismiss: Used in testsAccepted
Dismiss: Won't fixAccepted

Was this page helpful?

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARLINT, SONARQUBE, SONARCLOUD, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License