I have signed up to SonarQube using GitHub and copied the YAML snippet from the documentation to get started. I don’t have any server on AWS or anywhere where I am hosting my React application. I just have a basic React app in local and using that app to learn CI/CD using GitHub Actions.
I have gone through some existing solutions but most of them are referring to some hosting URL from AWS or so, but I am running the app locally. Not sure what will be the host URL in this case.
Error: SonarQube server [http://localhost:9000] can not be reached
PR: https://github.com/shanbiswas/github-actions-cicd-react-app/pull/10
`sonar.yml’:
on:
# Trigger analysis when pushing to your main branches, and when creating a pull request.
push:
branches:
- main
- 'releases/**'
pull_request:
types: [opened, synchronize, reopened]
name: Main Workflow
jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clones is recommended for improving the relevancy of reporting
fetch-depth: 0
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
sonar-project.properties
:
sonar.projectKey=shanbiswas_github-actions-cicd-react-app
# relative paths to source directories. More details and properties are described
# at https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/
sonar.sources=.
1