Skip to content

Commit 3afa96d

Browse files
authored
Create sonar.yml
1 parent 39ff310 commit 3afa96d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Sonar Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
build:
12+
name: Build
13+
runs-on: self-hosted
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
18+
- uses: sonarsource/sonarqube-scan-action@master
19+
env:
20+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
21+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
22+
# If you wish to fail your job when the Quality Gate is red, uncomment the
23+
# following lines. This would typically be used to fail a deployment.
24+
# We do not recommend to use this in a pull request. Prefer using pull request
25+
# decoration instead.
26+
# - uses: sonarsource/sonarqube-quality-gate-action@master
27+
# timeout-minutes: 5
28+
# env:
29+
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
30+

0 commit comments

Comments
 (0)