A regular analysis is required before analyzing a pull request

Hi,

We’re using SonarQube Enterprise Edition 7.9.3.

We’re migrating some projects to use SonarQube scans and we perform this scan on pull requests first before merging to the main branch. But this fails because:

A regular analysis is required before analyzing a pull request

So I wonder - how to introduce SonarQube on a project, though a feature branch or pull request, when it was never scanned…

This is a recurring issue we have for newly migrated projects and we’d like a simpler solution than running the scan locally :frowning:

Thanks for any help,
Damien Coraboeuf

Hey, you need to analyse the main branch of the project first. SonarQube need this “baseline” analysis to know what issue the PR introduced (doing the diff, basically).

If we have already run scans against PRs, how do we make a baseline scan?

Run an analysis on your main branch, then re-run your PR analysis to update them.

I’m running it with GitHub Actions though, should I setup one that I can run manually against our develop branch? Can I setup automatic analysis for our main branch through the UI and run my PRs with our GitHub Action?