Skip to content

Commit a41e377

Browse files
committed
Fix the logic to detect branch name
Signed-off-by: Huy Do <huydhn@gmail.com>
1 parent 042669d commit a41e377

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/scripts/upload_benchmark_results.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,16 @@ def get_git_metadata(repo_dir: str) -> Tuple[str, str]:
131131
hexsha,
132132
committed_date,
133133
)
134-
except TypeError as error:
135-
warning(f"Fail to get the branch name {e}")
136-
# This is a detached HEAD, default the branch to main
134+
except TypeError as e:
135+
# This is a detached HEAD, try to find out where the commit comes from
136+
for head in repo.heads:
137+
info(f"Check commits from {head.name}")
138+
for commit in repo.iter_commits(head):
139+
if commit.hexsha == hexsha:
140+
return repo_name, head.name, hexsha, committed_date
141+
142+
warning(f"Found no branch name, default to main: {e}")
143+
# We couldn't find the branch name
137144
return repo_name, "main", hexsha, committed_date
138145

139146

.github/workflows/vllm-benchmark.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,3 @@ jobs:
302302
--device-name "${DEVICE_NAME}" \
303303
--device-type "${SANITIZED_DEVICE_TYPE}" \
304304
--model "${MODELS//\//_}"
305-
306-
# DEBUG
307-
sleep 1800

0 commit comments

Comments
 (0)