fix: build github api headers with forge_headers

download.py read GITHUB_TOKEN only and missed the gh login token, the
readme built its header by hand, and the large files listing cached one
failed request as an empty release for the whole run.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 06:00:45 +01:00
1 parent 6138d43dfb
commit 8bfa188960
5 files changed
+44 -27

No files matched your search

+2 -5
View File
@@ -16,9 +16,9 @@ from devtools import prchecks
from model import releaserecord
from core.artifacts import write_if_changed
from core.cli import InputMissing
from core.github import github_token
from core.paths import DB_FILE, PLATFORMS_DIR, REPO_ROOT
from core.sizes import size_text
from core.upstream import forge_headers
from model.composition import compute_composition, count_catalog_matched
from model.declarations import declared_root
from model.guides import PACKAGE_COMMAND, install_command
@@ -513,10 +513,7 @@ def fetch_contributors() -> list[dict]:
import urllib.request
url = f"https://api.github.com/repos/{REPO}/contributors"
headers = {"User-Agent": "retrobios-readme/1.0"}
token = github_token()
if token:
headers["Authorization"] = f"token {token}"
headers = forge_headers(url, user_agent="retrobios-readme/1.0")
try:
req = urllib.request.Request(url, headers=headers)
with urllib.request.urlopen(req, timeout=10) as resp: