SonarQube and GitHub Actions are a common pairing in a modern DevOps stack. Here is how they fit together and a practical way to wire them up.
Where SonarQube fits
SonarQube statically analyzes code for bugs, vulnerabilities, security hotspots and 'code smells', and enforces a Quality Gate in CI so problematic changes fail the build.
# sonar-project.properties
sonar.projectKey=acme-web
sonar.sources=src
sonar.tests=test
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.qualitygate.wait=trueWhere GitHub Actions fits
GitHub Actions runs event-driven workflows (on push, PR, schedule, etc.) defined as YAML in .github/workflows, using reusable 'actions' from the marketplace or your own repos.
name: ci
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix: { node: [18, 20, 22] }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: ${{ matrix.node }}, cache: npm }
- run: npm ci
- run: npm testMaking them work together
- Enforce a 'new code' Quality Gate on every PR
- Wire coverage reports into the scan
- Pin actions to a commit SHA and review third-party actions before use
- Use OIDC for cloud auth and set minimal permissions blocks
Want this pairing set up properly, with docs and handover? That is exactly the kind of work CodeWizard's embedded senior engineers do - and both SonarQube and GitHub Actions have active community groups you can join for free.