You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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
2
2
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
4
4
5
5
6
-
## 🛠 Basic Set up - step by step
6
+
## 🛠 Basic Setup - step by step
7
7
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]
9
9
- Sign in with GitHub
10
10
- After login create SonarQube Token: In SonarQube UI → My Account → Security → Generate Token
11
-
- Import your org/repository
11
+
- Import your organization / repository
12
12
- Create a new project — choose automatic GitHub-based setup if available
13
13
- Add the token in GitHub repo: ➔ GitHub → Settings → Secrets and variables → Actions → New Repository Secret:
14
14
- Name: SONAR_TOKEN
15
15
- 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
16
18
- Create a file called sonar-project.properties and keep it in root of project:
17
19
```bash
18
20
sonar.projectKey=<YOUR_REPO_NAME>
@@ -23,9 +25,6 @@
23
25
```
24
26
This tells SonarScanner how to scan your project.
25
27
- 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.
0 commit comments