diff --git a/scripts/publish_test_metrics.py b/scripts/publish_test_metrics.py index 7741537..8fe38ad 100755 --- a/scripts/publish_test_metrics.py +++ b/scripts/publish_test_metrics.py @@ -225,7 +225,9 @@ def main() -> int: docs_rc_path = Path(os.getenv("QUALITY_GATE_DOCS_RC_PATH", "build/docs-naming.rc")) source_root = Path(os.getenv("SOURCE_ROOT", "atlasbot")) build_dir = Path(os.getenv("BUILD_DIR", "build")) - 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", "") if not junit_path.exists():