def get_latest_release_notes_from_changelog() -> str:
    """Get the release notes for the latest version from the changelog."""
    with open(ROOT_DIR / HISTORY_FILE, encoding='utf8') as f:
        for line in f:
            match = re.match(HISTORY_RELEASE_HEAD_REGEX, line)
            if match:
                break
        else:
            raise ValueError('Latest version not found in changelog')

        release_notes_li: list[str] = []
        for line in f:
            if re.match(HISTORY_RELEASE_HEAD_REGEX, line):
                break
            release_notes_li.append(line)
    return ''.join(release_notes_li)
Get the release notes for the latest version from the changelog.
release/push.py