-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.04 KB
/
sonarcloud.yml
File metadata and controls
40 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: SonarQube Scan
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarQubeScan:
name: SonarQube Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Install dependencies
run: npm install
# GitHub Action to run SonarQube scan
- name: Run SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v2.0.2
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# use https://your-sonarqube-server.com if using SonarQube or else use https://sonarcloud.io for SonarCloud
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# GitHub Action to check Quality Gate status after scan
- name: Quality Gate Check
uses: SonarSource/sonarqube-quality-gate-action@v1.1.0
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}