Browse Source

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

Co-authored-by: Cursor <cursoragent@cursor.com>
root 3 tháng trước cách đây
mục cha
commit
c6914f3890
1 tập tin đã thay đổi với 4 bổ sung và 0 xóa
  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]:
 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:
     def run(args: list[str]) -> str:
         try:
         try:
             return subprocess.check_output(args, cwd=repo, stderr=subprocess.DEVNULL, text=True).strip()
             return subprocess.check_output(args, cwd=repo, stderr=subprocess.DEVNULL, text=True).strip()