def get_branch_name(ref):
    """
    Take a full git ref name and return a more simple branch name.
    e.g. `refs/heads/demo/dude` -> `demo/dude`

    :param ref: the git head ref sent by GitHub
    :return: str the simple branch name
    """
    refs_prefix = 'refs/heads/'
    if ref.startswith(refs_prefix):
        # ref is in the form "refs/heads/master"
        ref = ref[len(refs_prefix):]

    return ref