Skip to content

Commit 60a629d

Browse files
committed
Include sonar cloud scan as part of linting
1 parent 419a676 commit 60a629d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/tox.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,17 @@ jobs:
230230
printf '### Failed as git reported modified and/or untracked files\n```\n%s\n```\n' "$(git status -s)" | tee -a "$GITHUB_STEP_SUMMARY"
231231
exit 99
232232
fi
233+
234+
- name: SonarCloud Scan
235+
uses: SonarSource/sonarqube-scan-action@v5
236+
# Tun sonar only for lint job if sonar config is present or sonar key
237+
# being present. This ensures that we fail the build if is misconfigured
238+
# but we do skip the step for projects that do not use sonar.
239+
if: matrix.name == 'lint' && (hashFiles('sonar-project.properties') != '' || env.SONAR_TOKEN != '') # 'if' cannot use 'secrets' context
240+
env:
241+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
242+
SONAR_TOKEN: ${{ secrets.CICD_ORG_SONAR_TOKEN_CICD_BOT }}
243+
233244
# https://github.com/actions/toolkit/issues/193
234245
check:
235246
if: always()

sonar-project.properties

Whitespace-only changes.

0 commit comments

Comments
 (0)