0.7.1
This commit is contained in:
@@ -537,7 +537,7 @@ async def fetch_repo_versions(
|
|||||||
- source: release|tag|branch
|
- source: release|tag|branch
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- Uses public endpoints (no tokens) for public repositories.
|
- Uses provider APIs; for GitHub we include the configured token (if any) to avoid unauthenticated rate limits.
|
||||||
- We prefer releases first (if available), then tags.
|
- We prefer releases first (if available), then tags.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -575,11 +575,13 @@ async def fetch_repo_versions(
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if prov == "github":
|
if prov == "github":
|
||||||
# Releases
|
# Releases (prefer these over tags)
|
||||||
gh_headers = {"Accept": "application/vnd.github+json", "User-Agent": UA}
|
# Use the configured GitHub token (if any) to avoid unauthenticated rate limits.
|
||||||
|
gh_headers = _github_headers(github_token)
|
||||||
|
per_page = max(1, min(int(limit), 100))
|
||||||
data, _ = await _safe_json(
|
data, _ = await _safe_json(
|
||||||
session,
|
session,
|
||||||
f"https://api.github.com/repos/{owner}/{repo}/releases?per_page={int(limit)}",
|
f"https://api.github.com/repos/{owner}/{repo}/releases?per_page={per_page}",
|
||||||
headers=gh_headers,
|
headers=gh_headers,
|
||||||
)
|
)
|
||||||
if isinstance(data, list):
|
if isinstance(data, list):
|
||||||
@@ -597,7 +599,7 @@ async def fetch_repo_versions(
|
|||||||
# Tags
|
# Tags
|
||||||
data, _ = await _safe_json(
|
data, _ = await _safe_json(
|
||||||
session,
|
session,
|
||||||
f"https://api.github.com/repos/{owner}/{repo}/tags?per_page={int(limit)}",
|
f"https://api.github.com/repos/{owner}/{repo}/tags?per_page={per_page}",
|
||||||
headers=gh_headers,
|
headers=gh_headers,
|
||||||
)
|
)
|
||||||
if isinstance(data, list):
|
if isinstance(data, list):
|
||||||
|
|||||||
Reference in New Issue
Block a user