File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -96,20 +96,20 @@ jobs:
9696 from pathlib import Path
9797 import os
9898
99- coverage = Path("coverage.xml")
100- content = coverage.read_text(encoding="utf-8")
99+ source_report = Path("coverage.xml")
100+ sonar_report = Path("coverage-sonar.xml")
101+ content = source_report.read_text(encoding="utf-8")
101102 normalized = content.replace("/github/workspace", os.environ["GITHUB_WORKSPACE"])
102-
103- if normalized != content:
104- coverage.write_text(normalized, encoding="utf-8")
105- print(f"Updated coverage.xml source paths to {os.environ['GITHUB_WORKSPACE']}")
106- else:
107- print("No /github/workspace path entries found in coverage.xml")
103+ sonar_report.write_text(normalized, encoding="utf-8")
104+ print(f"Wrote Sonar-ready coverage report to {sonar_report}")
108105 PY
109106
110107 -
111108 name : 🛏️ Upload Coverage
112109 uses : SonarSource/sonarqube-scan-action@v6
110+ with :
111+ args : >
112+ -Dsonar.python.coverage.reportPaths=coverage-sonar.xml
113113 env :
114114 SONAR_TOKEN : ${{secrets.SONAR_TOKEN}}
115115
You can’t perform that action at this time.
0 commit comments