Skip to content

Commit be2026c

Browse files
authored
sonar: Run in public mode (#157)
* sonar: Run in public mode * sonar: Fix secrets not being allowed in if conditions
1 parent a5c3155 commit be2026c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

.github/workflows/sonar.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a golang project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3-
41
name: Sonar Report
52

63
on:
@@ -25,6 +22,7 @@ jobs:
2522
run: go test -coverpkg=./... -coverprofile=coverage.out -json ./... > sonar-report.json
2623

2724
- name: Upload coverage reports to Sonar
28-
uses: sonarsource/sonarcloud-github-action@master
2925
env:
3026
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
27+
if: github.event.pull_request.head.repo.full_name == github.repository || env.SONAR_TOKEN != ''
28+
uses: sonarsource/sonarcloud-github-action@master

0 commit comments

Comments
 (0)