From f99bbf0d5b906000115b2bdd3ce44743b93a51dc Mon Sep 17 00:00:00 2001 From: Christian Fritz Date: Mon, 27 Feb 2023 21:52:55 +0100 Subject: [PATCH] Skip sonar cloud scan if no SONAR_TOKEN is not set. --- .github/workflows/go.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index cd7a6ae..fc2ed60 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -29,8 +29,8 @@ jobs: run: make ci-check - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master - if: github.event_name != 'pull_request' + uses: SonarSource/sonarcloud-github-action@v1.8 + if: (github.event_name != 'pull_request' && env.SONAR_TOKEN != '') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}