From 2ec8a412f42950b23bac39ee1f50995296be2d9c Mon Sep 17 00:00:00 2001 From: Gabriel Santos Date: Wed, 18 Dec 2024 17:04:53 -0300 Subject: [PATCH] Add to test --- .github/workflows/check_sonar_tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/check_sonar_tests.yml b/.github/workflows/check_sonar_tests.yml index 3123794..076e147 100644 --- a/.github/workflows/check_sonar_tests.yml +++ b/.github/workflows/check_sonar_tests.yml @@ -10,6 +10,8 @@ env: OWNER: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} PR_NUMBER: ${{ github.event.number }} + BRANCH_ORIGIN: ${{ github.head_ref }} + BASE_BRANCH: ${{ github.base_ref }} SONAR_HOST_URL: "https://sonarqube.trustly.one" SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_SECRET }} SONAR_PROJECT_KEY: "trustly-ios" @@ -25,6 +27,14 @@ jobs: with: fetch-depth: 0 + - name: Get Git Revision (Commit SHA) + id: git_revision + run: | + cd trustly-android-sdk || exit + git fetch origin "${BRANCH_ORIGIN}" + GIT_REVISION=$(git rev-parse origin/${BRANCH_ORIGIN}) + echo "Git Revision: $GIT_REVISION" + - name: Install dependencies run: | # Update Homebrew @@ -51,6 +61,10 @@ jobs: run: | # Create sonar-project.properties or update it dynamically echo "sonar.login=${{ secrets.SONAR_TOKEN_SECRET }}" >> sonar-project.properties + echo "sonar.pullrequest.key=${{ github.event.number }}" >> sonar-project.properties + echo "sonar.pullrequest.branch=${{ github.head_ref }}" >> sonar-project.properties + echo "sonar.pullrequest.base=${{ github.base_ref }}" >> sonar-project.properties + echo "sonar.scm.revision=${GIT_REVISION}" >> sonar-project.properties - name: Run Sonar-Swift Script run: |