Skip to content

Commit

Permalink
Update Sonar.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nimren9920 authored Sep 1, 2024
1 parent 181fc88 commit 4a8e0a6
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/Sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
java-version: 17
node-version: 20

- name: Install dependencies
run: npm install

- name: Cache SonarQube dependencies
uses: actions/cache@v2
Expand All @@ -29,10 +34,7 @@ jobs:
key: ${{ runner.os }}-sonar

- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
unzip sonar-scanner-cli-4.6.2.2472-linux.zip -d $HOME
export PATH="$HOME/sonar-scanner-4.6.2.2472-linux/bin:$PATH"
sonar-scanner -Dsonar.projectKey=your_project_key -Dsonar.sources=. -Dsonar.host.url=http://localhost:9000 -Dsonar.login=${SONAR_TOKEN}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

0 comments on commit 4a8e0a6

Please sign in to comment.