Skip to content

Commit

Permalink
ci(sage-monorepo): try sonar scan again for PRs originating from forks (
Browse files Browse the repository at this point in the history
#2460)

* Touch two OC projects

* Require label `sonar-scan-appproved` to run Sonar

* Remove hard coded PR number
  • Loading branch information
tschaffter authored Jan 26, 2024
1 parent 34d3b2e commit 80bd375
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Scan affected projects with Sonar
on:
pull_request_target:
types: [opened, synchronize, reopened]
types: [opened, synchronize, reopened, labeled]

env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}

jobs:
push:
sonar:
if: contains(github.event.pull_request.labels.*.name, 'sonar-scan-approved')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions apps/openchallenges/app/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<openchallenges-google-tag-manager *ngIf="useGoogleTagManager" />
<!-- XXX -->
<openchallenges-navbar
class="mat-elevation-z6"
[title]="title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

// XXX to trigger Sonar scan
@ComponentScan(basePackages = {"org.sagebionetworks.openchallenges"})
@EnableEurekaClient
@EnableFeignClients
Expand Down
2 changes: 0 additions & 2 deletions tools/sonar-scanner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ args=(
-Dsonar.python.coverage.reportPaths=${project_dir}/coverage.xml
)

pull_request_number=2458

# Include the PR key if specified
if [[ ! -z ${pull_request_number+z} ]];
then
Expand Down

0 comments on commit 80bd375

Please sign in to comment.