Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable SONAR scan in PRs created from forks #591

Merged
merged 9 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ jobs:

- name: SonarCloud Scan
uses: SonarSource/[email protected]
# Skip this test if the PR is created from a fork.
# If its created from a fork the PR won't be able to fetch the secrets so
# the step will fail.
if: github.event.pull_request.head.repo.full_name == github.repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4 changes: 4 additions & 0 deletions internal/runner/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os"
"os/exec"
"runtime"
"strconv"
"strings"
"syscall"
"testing"
Expand Down Expand Up @@ -347,6 +348,9 @@ func Test_runnerService(t *testing.T) {
})

t.Run("Input", func(t *testing.T) {
if skip, err := strconv.ParseBool(os.Getenv("SKIP_FLAKY")); err == nil && skip {
t.Skip("skipping flaky test")
}
t.Parallel()

stream, err := client.Execute(context.Background())
Expand Down
Loading