def get_all_versions(project):
    """Pull all the versions for a project from ReadTheDocs."""
    versions = []
    session = get_session("RTFD_TOKEN")

    url = f"https://readthedocs.org/api/v3/projects/{project}/versions/"
    while url:
        resp = session.get(url)
        resp.raise_for_status()
        data = resp.json()
        versions.extend(data["results"])
        url = data["next"]
    return versions
Pull all the versions for a project from ReadTheDocs.
ci/update_rtfd.py