File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1111 pull_request :
1212 types : [opened, synchronize, reopened]
1313jobs :
14+ sonarCheck :
15+ name : SonarQube config check
16+ runs-on : ubuntu-latest
17+ outputs :
18+ enabled : ${{ steps.check.outputs.enabled }}
19+ steps :
20+ - id : check
21+ env :
22+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
23+ SONAR_HOST_URL : ${{ secrets.SONAR_HOST }}
24+ run : |
25+ if [ -n "$SONAR_TOKEN" ] && [ -n "$SONAR_HOST_URL" ]; then
26+ echo "enabled=true" >> "$GITHUB_OUTPUT"
27+ echo "SonarQube secrets detected; scans will run."
28+ else
29+ echo "enabled=false" >> "$GITHUB_OUTPUT"
30+ echo "SonarQube secrets not configured; skipping scans."
31+ fi
32+
1433 sonarQubeServer :
1534 name : SonarQube Server
1635 runs-on : ubuntu-latest
36+ needs : sonarCheck
37+ if : ${{ needs.sonarCheck.outputs.enabled == 'true' }}
1738 steps :
1839 - uses : actions/checkout@v4
1940 with :
4566 sonarQubeFrontend :
4667 name : sonarQube Frontend
4768 runs-on : ubuntu-latest
69+ needs : sonarCheck
70+ if : ${{ needs.sonarCheck.outputs.enabled == 'true' }}
4871 steps :
4972 - uses : actions/checkout@v4
5073 with :
6891 sonarQubeScreenshot :
6992 name : SonarQube Screenshot
7093 runs-on : ubuntu-latest
94+ needs : sonarCheck
95+ if : ${{ needs.sonarCheck.outputs.enabled == 'true' }}
7196 steps :
7297 - uses : actions/checkout@v4
7398 with :
You can’t perform that action at this time.
0 commit comments