Run sonar cloud with current node.js LTS version
[e-mobility-charging-stations-simulator.git] / .github / workflows / ci.yml
index f7fc9451301a78676f753440fa6252b9e8485a46..d09db850f037520cb1939926a8d8f20df467efc3 100644 (file)
@@ -5,14 +5,12 @@ on:
       - master
   pull_request:
     types: [opened, synchronize, reopened]
-    branches:
-      - master
 jobs:
   build:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        node-version: [14.x]
+        node-version: [14.x, 16.x]
     steps:
     - uses: actions/checkout@v2
       with:
@@ -33,7 +31,8 @@ jobs:
     - name: npm run coverage
       run: npm run coverage
     - name: SonarCloud Scan
-      uses: SonarSource/sonarcloud-github-action@master
+      if: "github.repository == 'jerome-benoit/charging-stations-simulator' && matrix.node-version == '16.x'"
+      uses: sonarsource/sonarcloud-github-action@master
       env:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
         SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}