import requests


def get_last_tag(github_config, owner, repo):
    """ Get the last tag for the given repo """
    tags_url = '/'.join([github_config.api_url, 'repos', owner, repo, 'tags'])
    tags_response = requests.get(tags_url, headers=github_config.headers)
    tags_response.raise_for_status()
    tags_json = tags_response.json()
    return tags_json[0]['name']