From b1417f8ffd5ed4cd3ae87ab9d42adc4d6817e021 Mon Sep 17 00:00:00 2001 From: 7PH Date: Tue, 29 Aug 2023 09:04:32 +0200 Subject: [PATCH] SONAR-19707 Remove usage of GITHUB_TOKEN in GitHub Actions tutorials --- .../__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap | 3 --- .../js/components/tutorials/github-action/commands/DotNet.tsx | 1 - .../js/components/tutorials/github-action/commands/Gradle.tsx | 1 - .../components/tutorials/github-action/commands/JavaMaven.tsx | 1 - 4 files changed, 6 deletions(-) diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap index 841878b08e0..732ee2c8712 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap @@ -43,7 +43,6 @@ jobs: dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner - name: Build and analyze env: - GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any shell: powershell run: | .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.token="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}" @@ -223,7 +222,6 @@ jobs: restore-keys: \${{ runner.os }}-gradle - name: Build and analyze env: - GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }} run: ./gradlew build sonar --info" @@ -291,7 +289,6 @@ jobs: restore-keys: \${{ runner.os }}-m2 - name: Build and analyze env: - GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }} run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'" diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx index 4226826ce63..ddeb410a8d6 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/DotNet.tsx @@ -56,7 +56,6 @@ function dotnetYamlSteps(projectKey: string) { dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner - name: Build and analyze env: - GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any shell: powershell run: | .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"${projectKey}" /d:sonar.token="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}" diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx index 4ba91605c9a..a189a7d4f23 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/Gradle.tsx @@ -49,7 +49,6 @@ const GRADLE_YAML_STEPS = ` restore-keys: \${{ runner.os }}-gradle - name: Build and analyze env: - GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }} run: ./gradlew build sonar --info`; diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx index ad62c76d3c7..27704458624 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/JavaMaven.tsx @@ -49,7 +49,6 @@ function mavenYamlSteps(projectKey: string, projectName: string) { restore-keys: \${{ runner.os }}-m2 - name: Build and analyze env: - GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }} run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=${projectKey} -Dsonar.projectName='${projectName}'`; -- 2.39.5