INNER CODE UNIT · Python
update_cache_releases
simonw/simonw · build_readme.py:258
def update_cache_releases(cache, repo, full_release_pagination):
"""Merge a repo's releases into the cache. Returns nothing; mutates cache."""
name = repo["name"]
total = repo["releases"]["totalCount"]
if not total:
return
new_releases = filter_releases_by_author(name, repo["releases"]["nodes"])
# Only the seed/full run deep-paginates repos with >100 releases; the
# incremental run relies on the cache already holding the older ones.
if full_release_pagination and repo["releases"]["pageInfo"]["hasNextPage"]:
new_releases.extend(
fetch_all_repo_releases(
TOKEN,
repo["owner"]["login"],
name,
repo["releases"]["pageInfo"]["endCursor"],