def generate_changelog(releases):
    """Generates a changelog from GitHub release notes"""
    changelog = ""

    for release in releases:
        changelog += "\n## [{tag}]({url}) - {date}\n{body}\n".format(
            tag=release['tag_name'],
            url=release['html_url'],
            date=release['published_at'].split('T')[0],
            body=release['body'].replace('\r\n', '\n').replace('##', '###')
        )

    return changelog