Skip to content

Commit c0db1fe

Browse files
committed
Update yml file
1 parent d448698 commit c0db1fe

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.github/workflows/sonarqube.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ jobs:
2828
uses: SonarSource/sonarqube-scan-action@v2.0.2
2929
env:
3030
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
31-
SONAR_HOST_URL: https://sonarcloud.io # https://your-sonarqube-server.com if using sonarqube
31+
# use https://your-sonarqube-server.com if using sonarqube or else use https://sonarcloud.io for sonarcloud
32+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# Setup SonarCloud for a Node.js project with Github Action
1+
# Setup SonarQube for a Node.js project with Github Action
22

3-
> This sample app demonstrate how to set up SonarCloud with GitHub Actions for a Node.js project
3+
> This sample app demonstrate how to set up SonarQube with GitHub Actions for a Node.js project
44
55

6-
## 🛠 Basic Set up - step by step
6+
## 🛠 Basic Setup - step by step
77

8-
- You should have a SonarQube server (self-hosted) OR you can use SonarCloud https://www.sonarsource.com/products/sonarcloud/
8+
- You should have a SonarQube server (self-hosted) OR you can use SonarCloud https://www.sonarsource.com/products/sonarcloud/ [Here in this repo we will be using sonarcloud]
99
- Sign in with GitHub
1010
- After login create SonarQube Token: In SonarQube UI → My Account → Security → Generate Token
11-
- Import your org/repository
11+
- Import your organization / repository
1212
- Create a new project — choose automatic GitHub-based setup if available
1313
- Add the token in GitHub repo: ➔ GitHub → Settings → Secrets and variables → Actions → New Repository Secret:
1414
- Name: SONAR_TOKEN
1515
- value: your generated token
16+
- Name: SONAR_HOST_URL
17+
- value: use https://your-sonarqube-server.com if using sonarqube or else use https://sonarcloud.io for sonarcloud
1618
- Create a file called sonar-project.properties and keep it in root of project:
1719
```bash
1820
sonar.projectKey=<YOUR_REPO_NAME>
@@ -23,9 +25,6 @@
2325
```
2426
This tells SonarScanner how to scan your project.
2527
- Add GitHub Action Workflow (.github/workflows/sonarqube.yml): code is provided in the Repo.
26-
- Note:
27-
- If you use SonarCloud, then SONAR_HOST_URL=https://sonarcloud.io
28-
- sonar-project.properties must be in the project.
2928

3029
## 🔥 How does it work?
3130
- Code is pushed or PR created

0 commit comments

Comments
 (0)