Просмотр исходного кода

fix(host): honor HTH_GIT_COMMIT in the hardware evidence packager

Co-authored-by: Cursor <cursoragent@cursor.com>
root 3 месяцев назад
Родитель
Сommit
c6914f3890
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      tools/package_hth_hw_evidence.py

+ 4 - 0
tools/package_hth_hw_evidence.py

@@ -16,6 +16,10 @@ from package_hth_review import write_zip_file, zip_file_mode
 
 
 def git_info(repo: Path) -> tuple[str, str]:
+    env_head = os.environ.get("HTH_GIT_COMMIT", "").strip()
+    if env_head:
+        return env_head, os.environ.get("HTH_GIT_SHORT", env_head[:12])
+
     def run(args: list[str]) -> str:
         try:
             return subprocess.check_output(args, cwd=repo, stderr=subprocess.DEVNULL, text=True).strip()