We use SonarCloud - Github with Github Actions.
Our repository is a monorepo: PHP, Laravel, JS.
Analysis method: CI-based
We had the last SonarCloud analysis 20 hours ago. We created another PR 18 hours ago and there is no analysis we get. In actions menu of Github, there is no new workflow run for this PR.
That PR is waiting for SC analysis. CI-based analysis has been working well for 2 weeks since we shifted from automatic to CI-based.
What is the cause of this? This really blocks our process.
Our build.yml file:
name: build SC
on:
push:
branches:
- release # The default branch
- production # The other branches to be analyzed
pull_request:
branches:
- release # The default branch
- production
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Sorry to hear your scan is taking so long. Since you are using a CI pipeline, I would ask you if you would mind sharing logs with us? Gladly also as a private message. That way we could narrow down the reason a bit.
If I understand correctly, suddenly, your PRs do not receive the check at all. It is not long to come, it is never set. Is it correct?
Does the PR appear on the list of branches in the SonarCloud UI, or not?
I don’t understand this part:
In actions menu of Github, there is no new workflow run for this PR.
Do you mean that, on the GitHub side, the workflow supposed to trigger the SonarCloud scan did not start?
I suggest trying the workaround mentioned on this other thread, ie. close the PR and then re-open it and see it if triggers the expected workflow and then the check.
As discussed privately, it looks like the GitHub Actions workflow was never triggered for that PR.
Since this workflow does the SonarCloud scan, the other symptoms are expected: no scan happens, no report got sent to SonarCloud and the PR does not appear on the UI.
Since the Workflow configuration works for other PRs, it looks very much like a transient issue on the GitHub Action side. I’m afraid I can’t do anything from the SonarCloud perspective.