Skip to content

Commit 0a54ffb

Browse files
authored
Merge pull request #163 from amadeus4dev/add-sonarcloud-in-actions
add sonarcloud in actions
2 parents 2dec6d4 + 7f121bd commit 0a54ffb

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches: [ master ]
55
pull_request:
66
branches: [ master ]
7+
types: [opened, synchronize, reopened]
78
jobs:
89
build:
910
runs-on: Ubuntu-latest
@@ -25,3 +26,15 @@ jobs:
2526
run: npm test
2627
- name: Before deploy
2728
run: npm run docs
29+
sonarcloud:
30+
name: SonarCloud
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v2
34+
with:
35+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
36+
- name: SonarCloud Scan
37+
uses: SonarSource/sonarcloud-github-action@master
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
40+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sonar.projectKey=amadeus4dev_amadeus-node
2+
sonar.organization=amadeus4dev
3+
4+
# This is the name and version displayed in the SonarCloud UI.
5+
#sonar.projectName=amadeus-node
6+
#sonar.projectVersion=1.0
7+
8+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
9+
#sonar.sources=.
10+
11+
# Encoding of the source code. Default is default system encoding
12+
#sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)