Browse Source

fix: cant run sonar on forks for now

Lucas Severo Alves 4 years ago
parent
commit
199b6a5745
1 changed files with 2 additions and 4 deletions
  1. 2 4
      .github/workflows/ci.yml

+ 2 - 4
.github/workflows/ci.yml

@@ -21,9 +21,6 @@ env:
   # a step 'if env.GHCR_USERNAME' != ""', so we copy these to succinctly test whether
   # a step 'if env.GHCR_USERNAME' != ""', so we copy these to succinctly test whether
   # credentials have been provided before trying to run steps that need them.
   # credentials have been provided before trying to run steps that need them.
   GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
   GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
-  
-  # Sonar
-  SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
 
 
 jobs:
 jobs:
   detect-noop:
   detect-noop:
@@ -178,7 +175,8 @@ jobs:
           export KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT=true
           export KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT=true
           make test
           make test
 
 
-      - name: SonarCloud Scan
+      - name: SonarCloud Scans
+        if: secrets.SONAR_TOKEN != ''
         uses: SonarSource/sonarcloud-github-action@master
         uses: SonarSource/sonarcloud-github-action@master
         env:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any