From 0729a9363c52eab1d6f779cb09a257c012e052c3 Mon Sep 17 00:00:00 2001 From: RADhaigude <131800367+RADhaigude@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:29:02 +0530 Subject: [PATCH 1/7] Create sonarcloud.yml --- .github/workflows/sonarcloud.yml | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/sonarcloud.yml diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 0000000..6dd82c4 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,34 @@ +name: SonarCloud Scan + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + sonarcloud: + runs-on: ubuntu-latest + + steps: + # 1️⃣ Checkout repo + - uses: actions/checkout@v3 + + # 2️⃣ Set up Node.js + - uses: actions/setup-node@v3 + with: + node-version: 18 + + # 3️⃣ Install dependencies + - name: Install dependencies + run: npm install + + # 4️⃣ Run SonarCloud scan + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + with: + organization: RADhaigude + projectKey: react-projects + token: ${{ secrets.SONAR_TOKEN }} From d8396099828a0417265f597bcc1af39945e41270 Mon Sep 17 00:00:00 2001 From: RADhaigude <131800367+RADhaigude@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:32:49 +0530 Subject: [PATCH 2/7] Update sonarcloud.yml --- .github/workflows/sonarcloud.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 6dd82c4..2f44132 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -1,34 +1,27 @@ -name: SonarCloud Scan +name: Test SonarCloud Connection on: - push: - branches: - - main - pull_request: - branches: - - main + workflow_dispatch: # Allows manual trigger in GitHub Actions jobs: - sonarcloud: + test-sonar: runs-on: ubuntu-latest steps: - # 1️⃣ Checkout repo + # 1️⃣ Checkout code - uses: actions/checkout@v3 - # 2️⃣ Set up Node.js + # 2️⃣ Set up Node.js (for React project) - uses: actions/setup-node@v3 with: node-version: 18 - # 3️⃣ Install dependencies - - name: Install dependencies - run: npm install - - # 4️⃣ Run SonarCloud scan - - name: SonarCloud Scan + # 3️⃣ Test SonarCloud connection + - name: SonarCloud Connection Test uses: SonarSource/sonarcloud-github-action@master with: organization: RADhaigude projectKey: react-projects token: ${{ secrets.SONAR_TOKEN }} + # Optional dry run flag (checks connection without full scan) + args: "-Dsonar.analysis.mode=preview" From 747ec01a92285c34758e80b5d6e85e34eac640ca Mon Sep 17 00:00:00 2001 From: RADhaigude <131800367+RADhaigude@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:34:28 +0530 Subject: [PATCH 3/7] Update sonarcloud.yml --- .github/workflows/sonarcloud.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 2f44132..50967e1 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -1,27 +1,25 @@ name: Test SonarCloud Connection on: - workflow_dispatch: # Allows manual trigger in GitHub Actions + workflow_dispatch: # manual trigger jobs: test-sonar: runs-on: ubuntu-latest steps: - # 1️⃣ Checkout code - - uses: actions/checkout@v3 + - name: Checkout repo + uses: actions/checkout@v3 - # 2️⃣ Set up Node.js (for React project) - - uses: actions/setup-node@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 with: node-version: 18 - # 3️⃣ Test SonarCloud connection - - name: SonarCloud Connection Test + - name: Test SonarCloud connection uses: SonarSource/sonarcloud-github-action@master with: organization: RADhaigude projectKey: react-projects token: ${{ secrets.SONAR_TOKEN }} - # Optional dry run flag (checks connection without full scan) - args: "-Dsonar.analysis.mode=preview" + From 0ad598de8d1e6984e1d3c5424821439dcdd3fb8f Mon Sep 17 00:00:00 2001 From: RADhaigude <131800367+RADhaigude@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:42:42 +0530 Subject: [PATCH 4/7] Update sonarcloud.yml --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 50967e1..c108663 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -20,6 +20,6 @@ jobs: uses: SonarSource/sonarcloud-github-action@master with: organization: RADhaigude - projectKey: react-projects + projectKey: RADhaigude-react-projects token: ${{ secrets.SONAR_TOKEN }} From 7ecb7a2a6a9248291c577a5940e428d20325ccb3 Mon Sep 17 00:00:00 2001 From: RADhaigude <131800367+RADhaigude@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:43:25 +0530 Subject: [PATCH 5/7] Rename sonarcloud.yml to 1sonarcloud.yml --- .github/workflows/{sonarcloud.yml => 1sonarcloud.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{sonarcloud.yml => 1sonarcloud.yml} (100%) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/1sonarcloud.yml similarity index 100% rename from .github/workflows/sonarcloud.yml rename to .github/workflows/1sonarcloud.yml From adba27387f7b2625a18a36883930fe7e5c731315 Mon Sep 17 00:00:00 2001 From: RADhaigude <131800367+RADhaigude@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:46:26 +0530 Subject: [PATCH 6/7] Update 1sonarcloud.yml --- .github/workflows/1sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/1sonarcloud.yml b/.github/workflows/1sonarcloud.yml index c108663..a6048f0 100644 --- a/.github/workflows/1sonarcloud.yml +++ b/.github/workflows/1sonarcloud.yml @@ -17,7 +17,7 @@ jobs: node-version: 18 - name: Test SonarCloud connection - uses: SonarSource/sonarcloud-github-action@master + uses: SonarSource/sonarqube-scan-action@v5.0.0 with: organization: RADhaigude projectKey: RADhaigude-react-projects From b31c46aa7e7e11a3e380d255ed331a0702d8af72 Mon Sep 17 00:00:00 2001 From: RADhaigude <131800367+RADhaigude@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:54:34 +0530 Subject: [PATCH 7/7] Update 1sonarcloud.yml --- .github/workflows/1sonarcloud.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/1sonarcloud.yml b/.github/workflows/1sonarcloud.yml index a6048f0..1e40542 100644 --- a/.github/workflows/1sonarcloud.yml +++ b/.github/workflows/1sonarcloud.yml @@ -1,14 +1,14 @@ -name: Test SonarCloud Connection +name: SonarCloud Scan on: - workflow_dispatch: # manual trigger + workflow_dispatch: # allows manual trigger jobs: - test-sonar: + sonarcloud: runs-on: ubuntu-latest steps: - - name: Checkout repo + - name: Checkout repository uses: actions/checkout@v3 - name: Setup Node.js @@ -16,10 +16,17 @@ jobs: with: node-version: 18 - - name: Test SonarCloud connection + - name: Install dependencies + run: npm install + + - name: Run SonarCloud Scan uses: SonarSource/sonarqube-scan-action@v5.0.0 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: - organization: RADhaigude - projectKey: RADhaigude-react-projects - token: ${{ secrets.SONAR_TOKEN }} + args: > + -Dsonar.projectKey=RADhaigude_react-projects + -Dsonar.organization=radhaigude + -Dsonar.sources=src + -Dsonar.host.url=https://sonarcloud.io