From 8d196d86ba54e2c78165aa0474d968abb56e95ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 03:56:02 +0000 Subject: [PATCH] Use GITHUB_TOKEN for slang release API request to avoid rate limits --- .github/workflows/ci.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.py b/.github/workflows/ci.py index 09aca5beb..da29346b9 100644 --- a/.github/workflows/ci.py +++ b/.github/workflows/ci.py @@ -108,9 +108,13 @@ def install_slang_compiler() -> None: machine = platform.machine().lower() arch = 'aarch64' if machine in ('aarch64', 'arm64') else 'x86_64' + api_headers: dict[str, str] = {'Accept': 'application/vnd.github+json', 'X-GitHub-Api-Version': '2022-11-28'} + gh_token = os.environ.get('GITHUB_TOKEN') + if gh_token: + api_headers['Authorization'] = f'token {gh_token}' api_req = Request( 'https://api.github.com/repos/shader-slang/slang/releases/latest', - headers={'Accept': 'application/vnd.github+json', 'X-GitHub-Api-Version': '2022-11-28'}, + headers=api_headers, ) release = json.loads(download_with_retry(api_req)) version = release['tag_name'].lstrip('v')