def check_upstream_branch(github, branch):
    """
    Checks if the given branch already exists in the upstream repository
    """
    github_branch = github.get_branch(branch)

    # Return True if the branch exists
    return github_branch and github_branch.get('name', False)