From 15c57ec960b85851a278b8726eced83e74ecd1e9 Mon Sep 17 00:00:00 2001 From: Gabriel Santos Date: Mon, 25 Nov 2024 16:21:32 -0300 Subject: [PATCH] Add to test --- .github/workflows/sonar_analysis.yml | 17 +++++++++++------ ...ger_sonar.yml => trigger_sonar_disabled.yml} | 0 2 files changed, 11 insertions(+), 6 deletions(-) rename .github/workflows/{trigger_sonar.yml => trigger_sonar_disabled.yml} (100%) diff --git a/.github/workflows/sonar_analysis.yml b/.github/workflows/sonar_analysis.yml index 73c0ad4..583bca4 100644 --- a/.github/workflows/sonar_analysis.yml +++ b/.github/workflows/sonar_analysis.yml @@ -4,21 +4,23 @@ on: pull_request: types: [opened, edited, reopened, synchronize] workflow_dispatch: - env: GH_TOKEN: ${{ secrets.GIT_TOKEN_SECRET }} OWNER: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} PR_NUMBER: ${{ github.event.number }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_HOST_URL: "https://sonarqube.trustly.one" SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_SECRET }} - + jobs: build: runs-on: macOS-latest steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up Ruby uses: ruby/setup-ruby@v1 @@ -48,11 +50,14 @@ jobs: - name: SonarQube Analysis run: | sonar-scanner \ - -Dsonar.host.url=https://sonarqube.trustly.one \ - -Dsonar.login="${SONAR_TOKEN}" \ + -Dsonar.host.url=${SONAR_HOST_URL} \ + -Dsonar.login=${SONAR_TOKEN} \ -Dsonar.projectKey="trustly-ios" \ -Dsonar.projectName="trustly-ios" \ -Dsonar.branch.name="${{ github.head_ref }}" \ + -Dsonar.pullrequest.base="${{ github.base_ref }}" \ + -Dsonar.pullrequest.branch="${{ github.head_ref }}" \ + -Dsonar.pullrequest.key="${{ github.event.pull_request.number }}" \ -Dsonar.sources="." \ -Dsonar.exclusions="**/Pods/**,**/Tests/**" \ -Dsonar.verbose=true \ No newline at end of file diff --git a/.github/workflows/trigger_sonar.yml b/.github/workflows/trigger_sonar_disabled.yml similarity index 100% rename from .github/workflows/trigger_sonar.yml rename to .github/workflows/trigger_sonar_disabled.yml