diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ce9e9a..145f9d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,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 224d290..b9ef651 100644 --- a/build.gradle +++ b/build.gradle @@ -6,8 +6,8 @@ plugins { sonar { properties { - property "sonar.projectKey", "deprecated-java-api-demo-1" property "sonar.projectName", "deprecated-java-api-demo-1" + property "sonar.links.scm", "https://github.com/sourcegraph-testing/deprecated-java-api-demo-1" } }