Skip to content

Commit

Permalink
Fix condition for running sonar (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov authored Aug 5, 2024
1 parent db406e6 commit e7f7bd5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ jobs:
run: ./gradlew spotlessCheck build
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Sonar
if: secrets.SONAR_TOKEN != ''
run: ./gradlew jacocoTestReport sonar
- name: Run SonarQube analysis
run: |
if [ -n "$SONAR_TOKEN" ]; then
./gradlew jacocoTestReport sonar
else
echo "SONAR_TOKEN is not set. Skipping SonarQube analysis."
fi
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 comments on commit e7f7bd5

Please sign in to comment.