diff --git a/scripts/publish_quality_metrics.py b/scripts/publish_quality_metrics.py index c46dd83..0a047ba 100755 --- a/scripts/publish_quality_metrics.py +++ b/scripts/publish_quality_metrics.py @@ -338,7 +338,9 @@ def main(argv: list[str] | None = None) -> int: resolved_failed = max(args.local_failed, remote_failed) coverage_percent = _read_coverage_percent(args.coverage_percent_file) source_lines_over_500 = _count_source_files_over_limit(repo_root, max_lines=500) - branch = os.getenv("BRANCH_NAME", os.getenv("GIT_BRANCH", "")) + branch = os.getenv("BRANCH_NAME") or os.getenv("GIT_BRANCH") or "unknown" + if branch.startswith("origin/"): + branch = branch[len("origin/") :] build_number = os.getenv("BUILD_NUMBER", "") quality_output = Path(os.getenv("ANANKE_QUALITY_OUTPUT_FILE", str(build_dir / "quality-gate.out"))) tests = _parse_go_test_counts(quality_output)