We use SonarCloud and GitHub on a private project, part of the PR requirements is to run Sonar and block the PR if the Sonar check fails. This works very well and is helping us keep high quality standards.
Once in a while, I would say several times a week in our case, Sonarcloud bot will post the status on the GitHub PR but the SonarCloud Code Analysis check will still be pending. We do see the same issue with some of the other checks we mandate for our PRs.
We do suspect this is an issue with the GitHub API receiving the confirmation that the check completed but with that API either failing outright or dropping the message and never reflecting the result in the PR.
Could you check with your SonarCloud server side logs if such notifications are getting errors from the GitHub API and maybe implement an option to force notify the PR when a user comes to check the dashboard for the PR on sonarcloud.io.
Right now we are forced to re-run the PR pipelines when this happens and that’s a waist of time for our development team.
I can’t share urls here since we are on a private project but can share more details if you PM me.
It is similar to this report GitHub check "SonarCloud Code Analysis" never clears but not as severe.