Run sonar cloud with current node.js LTS version
[e-mobility-charging-stations-simulator.git] / .github / workflows / ci.yml
index 90687ea258c89c8f12b0ef8c6e876a50e9a991db..d09db850f037520cb1939926a8d8f20df467efc3 100644 (file)
@@ -3,10 +3,8 @@ on:
   push:
     branches:
       - master
-  pull_request_target:
+  pull_request:
     types: [opened, synchronize, reopened]
-    branches:
-      - master
 jobs:
   build:
     runs-on: ubuntu-latest
@@ -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 }}