File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 with :
2525 fetch-depth : 0 # Quan trọng để SonarCloud so sánh code
2626
27- - name : debug
28- working-directory : .
29- run : ls -la
30-
3127 - name : Setup Java
3228 uses : actions/setup-java@v4
3329 with :
@@ -44,18 +40,19 @@ jobs:
4440 - name : Install dependencies
4541 run : flutter pub get
4642
47- - name : SonarCloud Scan
48- uses : SonarSource/sonarcloud-github-action@v2
43+ - name : Run Sonar Scanner Native OS
4944 env :
50- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Bắt buộc để SonarCloud tự động comment báo cáo vào Pull Request
45+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Bắt buộc để SonarCloud tự động comment báo cáo
5146 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }} # Token cấp quyền từ SonarCloud
52- with :
53- projectBaseDir : src
54- args : >
55- -Dsonar.organization=tqha1011
56- -Dsonar.projectKey=tqha1011_taskmanagementapp
57- -Dsonar.sources=lib
58- -Dsonar.exclusions=**/*.g.dart,**/*.freezed.dart,**/*.part.dart
59-
60-
61-
47+ run : |
48+ # 1. Tải Sonar Scanner CLI (bản gốc cho Linux) trực tiếp từ máy chủ
49+ wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
50+ unzip -q sonar-scanner-cli-5.0.1.3006-linux.zip
51+
52+ # 2. Chạy lệnh quét trực tiếp trên Ubuntu
53+ ./sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner \
54+ -Dsonar.organization=tqha1011 \
55+ -Dsonar.projectKey=tqha1011_taskmanagementapp \
56+ -Dsonar.sources=lib \
57+ -Dsonar.exclusions="**/*.g.dart,**/*.freezed.dart,**/*.part.dart" \
58+ -Dsonar.host.url=https://sonarcloud.io
You can’t perform that action at this time.
0 commit comments