Просмотр исходного кода

Fix condition for running SonarCloud scans

Since making this conditional, they have not been running at all.
It seems github.event_name is what was needed for testing for pushes.
Also, there needs to be a check that we are running on the main repository,
so that forks do not get failures due to unset SonarCloud credentials
Jason Rumney 3 лет назад
Родитель
Сommit
2b6a9f85ae
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      .github/workflows/tests.yml

+ 1 - 1
.github/workflows/tests.yml

@@ -28,7 +28,7 @@ jobs:
         run: git fetch --no-tags https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY +refs/heads/main:refs/remotes/origin/main
       - name: SonarCloud scan
         uses: sonarsource/sonarcloud-github-action@master
-        if: ${{ github.event.type == 'push' }}
+        if: github.event_name == 'push' && github.event.repository.name == 'make-all/tuya-local'
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}