diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1413c06..5730edf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,10 @@ jobs: - name: SonarQube analysis # Analysis is advisory: a failed or unconfigured scan must not fail the build. continue-on-error: true + # SONAR_PROJECT_KEY is a repository variable holding the key SonarQube + # assigned when this repo was imported via the GitHub App. + if: ${{ vars.SONAR_PROJECT_KEY != '' }} env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: ./gradlew sonar --info + run: ./gradlew sonar --info -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }} diff --git a/build.gradle b/build.gradle index 7b92be2..5859c31 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ plugins { sonar { properties { - property "sonar.projectKey", "deprecated-java-api-demo-2" property "sonar.projectName", "deprecated-java-api-demo-2" + property "sonar.links.scm", "https://github.com/sourcegraph-testing/deprecated-java-api-demo-2" } }