import logging


def lookup_release(repo, tag_name):
    """The release corresponding to a tag name."""

    for release in repo.get_releases():
        if release.tag_name == tag_name:
            logging.info('Found release for tag %s: %s', tag_name, release)
            return release
    logging.info('Failed to find release for tag %s', tag_name)
    return None