Explorar o código

Avoid running SonarCloud scan on pull requests.

Pull requests do not have access to the Sonar token, so always fail.
Jason Rumney %!s(int64=4) %!d(string=hai) anos
pai
achega
514af69deb
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      .github/workflows/tests.yml

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

@@ -28,6 +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
         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
       - name: SonarCloud scan
         uses: sonarsource/sonarcloud-github-action@master
         uses: sonarsource/sonarcloud-github-action@master
+        if: ${{ github.event.type == 'push' }}
         env:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}