diff --git a/ci/scripts/publish_test_metrics.py b/ci/scripts/publish_test_metrics.py index 214f0212..662653c7 100644 --- a/ci/scripts/publish_test_metrics.py +++ b/ci/scripts/publish_test_metrics.py @@ -246,7 +246,9 @@ def main() -> int: junit_glob = os.getenv("JUNIT_GLOB", os.getenv("JUNIT_PATH", "build/junit-*.xml")) exit_code_path = os.getenv("QUALITY_GATE_EXIT_CODE_PATH", os.getenv("GLUE_EXIT_CODE_PATH", "build/quality-gate.rc")) summary_path = os.getenv("QUALITY_GATE_SUMMARY_PATH", "build/quality-gate-summary.json") - 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", "") tests = _collect_junit_totals(junit_glob)