After GitHub PRs are merged, Sonar seems to run a new analysis and post a new comment.
This happen on every PR across every repo. An example is below, where you can see the PR is merged, branch is deleted, and then at the end a sonar comment.
I use automatic analysis for sonar, no actual workflows in GitHub.
I don’t think anything I’ve changed is causing this behavior. I use squash and merge and have used that for years. This behavior in sonar just started in the last 1-2 weeks maybe.
I don’t see much value in analyzing PRs again after they are merged. Is this a bug or a feature? And can it be turned off?
Thanks for the detailed report. To clarify what’s expected: when a PR is merged, SonarQube Cloud does run a fresh branch analysis on the target branch (e.g., main) — that’s normal
and intentional, since it keeps overall project metrics up to date after the merge.
However, a new comment appearing on the already-merged/closed PR itself is not expected behavior, PR comments should only update while the PR is open.
To help us track this down: when you see the PR “analyzed again,” is it a brand-new comment (a second, separate comment block), or does the existing comment get edited/updated in place? A screenshot or a direct link to a PR where you can see this happening again would help us confirm and dig into the logs.
I already linked a PR where this happened (although it’s happening in all PRs in all my repos as far as I know).
It is a brand new comment, and the old comment is deleted. That’s exactly how it handles updates to an open PR as well. Side note: this is actually behavior I’m not a huge fan of and would prefer an option to edit existing comments like codecov does, but I guess this is not a huge deal… though when the PR has been open for a long time it almost is never able to delete the old comment.
We investigated the linked PR and confirmed this was a bug.
The comment after merge was not expected behavior, and it was not the normal target-branch analysis that runs after a PR is merged. In some cases, Automatic Analysis was incorrectly scheduling an additional PR analysis after merge, which caused the PR comment to be recreated.
A fix was deployed on June 30, 2026. Newly merged PRs should no longer see this behavior.
Please let us know if you still see it on a PR merged after June 30, 2026, and we’ll investigate that specific case.