diff --git a/setup.py b/setup.py index d5782a81d8..a809c66c83 100644 --- a/setup.py +++ b/setup.py @@ -657,13 +657,18 @@ class precompiled_wheel_utils: def get_base_commit_in_main_branch() -> str: try: # Get the latest commit hash of the upstream main branch. - resp_json = subprocess.check_output( - [ - "curl", - "-s", - "https://api.github.com/repos/vllm-project/vllm/commits/main", + curl_cmd = [ + "curl", + "-s", + "https://api.github.com/repos/vllm-project/vllm/commits/main", + ] + github_token = os.getenv("GH_TOKEN", os.getenv("GITHUB_TOKEN")) + if github_token: + curl_cmd += [ + "-H", + f"Authorization: token {github_token}", ] - ).decode("utf-8") + resp_json = subprocess.check_output(curl_cmd).decode("utf-8") upstream_main_commit = json.loads(resp_json)["sha"] print(f"Upstream main branch latest commit: {upstream_main_commit}")