Skip to content

Commit 8cb1461

Browse files
committed
Update file
1 parent 4ec2d92 commit 8cb1461

File tree

4 files changed

+14
-21
lines changed

4 files changed

+14
-21
lines changed
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: SonarQube Scan
22

33
on:
44
push:
5-
# branches:
6-
# - main
5+
branches:
6+
- main
77
pull_request:
88
types: [opened, synchronize, reopened]
99

@@ -28,11 +28,5 @@ jobs:
2828
uses: SonarSource/sonarqube-scan-action@v2.0.2
2929
env:
3030
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
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 }}
33-
34-
- name: Quality Gate Check
35-
uses: SonarSource/sonarqube-quality-gate-action@v1.1.0
36-
timeout-minutes: 5
37-
env:
38-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
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 & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Setup SonarQube for a Node.js project with Github Action
1+
# Setup SonarCloud for a Node.js project with Github Action
22

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

66
## 🛠 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/ [Here in this repo we will be using 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
1111
- Import your organization / repository
@@ -14,7 +14,7 @@
1414
- Name: SONAR_TOKEN
1515
- value: your generated token
1616
- Name: SONAR_HOST_URL
17-
- value: use https://your-sonarqube-server.com if using sonarqube or else use https://sonarcloud.io for sonarcloud
17+
- value: use https://your-sonarqube-server.com if using SonarQube or else use https://sonarcloud.io for SonarCloud
1818
- Create a file called sonar-project.properties and keep it in root of project:
1919
```bash
2020
sonar.projectKey=<YOUR_PROJECT_KEY>
@@ -24,7 +24,7 @@
2424
sonar.language=js
2525
```
2626
This tells SonarScanner how to scan your project.
27-
- Add GitHub Action Workflow (.github/workflows/sonarqube.yml): code is provided in the Repo.
27+
- Add GitHub Action Workflow (.github/workflows/sonarcloud.yml): code is provided in the Repo.
2828

2929
## 🔥 How does it work?
3030
- Whenever your code is pushed or a PR is created, GitHub Action runs, SonarQube scanner checks your code and update SonarQube dashboard with report
@@ -33,10 +33,10 @@
3333

3434
```bash
3535
# Clone the repo
36-
git clone https://github.com/rupachowrasia/nodejs-sonarqube-setup-with-github-action.git
36+
git clone https://github.com/rupachowrasia/nodejs-sonarcloud-setup-with-github-action.git
3737

3838
# Move into the project directory
39-
cd nodejs-sonarqube-setup-with-github-action
39+
cd nodejs-sonarcloud-setup-with-github-action
4040

4141
# Install dependencies
4242
npm install

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
2-
"name": "nodejs-sonarqube-setup-using-github-action",
2+
"name": "nodejs-sonarcloud-setup-with-github-action",
33
"version": "1.0.0",
4-
"description": "",
4+
"description": "> This sample app demonstrate how to set up SonarCloud with GitHub Actions for a Node.js project",
55
"main": "index.js",
66
"scripts": {
7-
"start": "node index.js",
87
"test": "echo \"Error: no test specified\" && exit 1"
98
},
109
"repository": {

0 commit comments

Comments
 (0)