Skip to content

Commit

Permalink
Updating conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarev committed Nov 11, 2024
1 parent ae99747 commit 4e3f456
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,16 @@ jobs:
GH_REF: ${{ github.ref }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
if [ "$GH_EVENT" = "pull_request" ]; then # If this is a PR, then add pointers to it
./gradlew -Dorg.gradle.jvmargs=-Xmx5g sonar --no-daemon -x build -x test \
-Dsonar.pullrequest.base="$GH_PR_BASE_REF" \
-Dsonar.pullrequest.branch="$GH_PR_HEAD_REF" \
-Dsonar.pullrequest.key="$GH_PR_NUMBER" \
-Dsonar.token="$SONAR_TOKEN"
if [ "$GH_EVENT" = "pull_request" ]; then
if [ "$SONAR_TOKEN" != "" ]; then
./gradlew -Dorg.gradle.jvmargs=-Xmx5g sonar --no-daemon -x build -x test \
-Dsonar.pullrequest.base="$GH_PR_BASE_REF" \
-Dsonar.pullrequest.branch="$GH_PR_HEAD_REF" \
-Dsonar.pullrequest.key="$GH_PR_NUMBER" \
-Dsonar.token="$SONAR_TOKEN"
else
echo "Skipping SonarQube analysis."
fi
else
./gradlew -Dorg.gradle.jvmargs=-Xmx5g sonar --no-daemon -x build -x test \
-Dsonar.branch.name="$GH_REF" \
Expand Down

0 comments on commit 4e3f456

Please sign in to comment.