From 40c4bf0fe639cbeffb99fd51afabd02d2dc13f75 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 14 Mar 2023 20:05:41 +0100 Subject: [PATCH] ci: disable sonarcloud on forks (#15400) --- .github/workflows/test.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1aab15ae477c..b5eef867e929 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -267,7 +267,7 @@ jobs: cd client/v2 go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -297,7 +297,7 @@ jobs: cd core go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -327,7 +327,7 @@ jobs: cd depinject go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -355,7 +355,7 @@ jobs: cd errors go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -385,7 +385,7 @@ jobs: cd math go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -420,7 +420,7 @@ jobs: cd simapp go test -mod=readonly -timeout 30m -tags='app_v1 norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -455,7 +455,7 @@ jobs: cd tools/rosetta go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -485,7 +485,7 @@ jobs: cd collections go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -515,7 +515,7 @@ jobs: cd tools/cosmovisor go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -545,7 +545,7 @@ jobs: cd tools/confix go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: env.GIT_DIFF + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -575,7 +575,7 @@ jobs: cd tools/hubl go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: env.GIT_DIFF + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -605,7 +605,7 @@ jobs: cd store go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -635,7 +635,7 @@ jobs: cd log go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -672,7 +672,7 @@ jobs: cd x/tx go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -702,7 +702,7 @@ jobs: cd x/nft go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -732,7 +732,7 @@ jobs: cd x/circuit go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -762,7 +762,7 @@ jobs: cd x/feegrant go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -792,7 +792,7 @@ jobs: cd x/evidence go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -821,7 +821,7 @@ jobs: cd x/upgrade go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./... - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}