Skip to content

Commit e354397

Browse files
Fix SonarQube step
1 parent 77b4140 commit e354397

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,32 @@ jobs:
3737

3838
- name: npm Build
3939
run: npm run build
40+
41+
- name: SonarQube Scan (Push)
42+
if: github.event_name == 'push'
43+
uses: SonarSource/sonarqube-scan-action@v7
44+
env:
45+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
46+
SONAR_HOST_URL: ${{ vars.SONARQUBE_HOST }}
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
projectBaseDir: .
50+
args: >
51+
-Dsonar.host.url=${{ env.SONAR_HOST_URL }}
52+
-Dsonar.projectVersion=${{ env.VERSION }}
53+
54+
- name: SonarQube Scan (Pull Request)
55+
if: github.event_name == 'pull_request'
56+
uses: SonarSource/sonarqube-scan-action@v7
57+
env:
58+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
59+
SONAR_HOST_URL: ${{ vars.SONARQUBE_HOST }}
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
projectBaseDir: .
63+
args: >
64+
-Dsonar.host.url=${{ env.SONAR_HOST_URL }}
65+
-Dsonar.projectVersion=${{ env.VERSION }}
66+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
67+
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
68+
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}

0 commit comments

Comments
 (0)