"main" branch has not been analyzed yet and you have multiple branches already. It looks like it is

Hello everyone,

I hope you’re doing well! I’m experiencing an issue with my GitHub Actions workflow and I was hoping someone could point me in the right direction.

When I create a pull request (PR) to the main branch, I only see the PR itself along with the Quality Gates report. However, I don’t get the overview on the main branch, which I would normally expect to see when the PR is opened or merged.

Here’s some more information about the setup:

ALM Used:

  • GitHub

CI System Used:

  • GitHub Actions

Scanner Command Used:

  • SonarCloud analysis is triggered in the Build_Test_Coverage_Analyse job using the SonarSource/sonarcloud-github-action GitHub Action.

Languages in the Repository:

  • JavaScript (Frontend code in the front folder of the repository)

SonarCloud Project (if applicable):

Error Observed:

  • When opening a PR against the main branch, the overview of the PR does not appear as expected on the main branch, and I only see the Quality Gates in the PR checks.

Steps to Reproduce:

  1. Open a pull request targeting the main branch in the repository.
  2. The quality gates are visible, but the overview for the main branch is missing.

Potential Workaround:

  • I have tried triggering the PR with the GitHub Actions workflow, but I haven’t been able to figure out how to show the main branch overview in the pull request. Any suggestions would be much appreciated!

Thanks a lot in advance!


Hey there.

Your backend workflow seems to be pushing to a SonarCloud project on the main branch (SonarCloud), but your frontend workflow is only running on Pull Requests.

name: Frontend Workflow

on:
  # Déclenche le workflow lors d'un push sur la branche "feature/workflow" dans le dossier "front" pour tester pendant le developpement 
#  push:
#    branches:
#      - feature/workflow-app
#    paths:
#      - 'front/**'

  # Déclenche le workflow lors d'une pull request vers la branche "main" dans le dossier "front"
  pull_request:
    branches:
      - main
    paths:
      - 'front/**'

You probably want the on/push section of this workflow (which is currently commented out) to look more like your backend workflow (which isn’t commented out!) if you want it running on more than PRs.