def do_pr(gh_token, sdk_git_id, sdk_pr_target_repo_id, branch_name, base_branch, pr_body=""):  # pylint: disable=too-many-arguments
    "Do the PR"
    if not gh_token:
        _LOGGER.info('Skipping the PR, no token found')
        return None
    if not sdk_pr_target_repo_id:
        _LOGGER.info('Skipping the PR, no target repo id')
        return None

    github_con = Github(gh_token)
    sdk_pr_target_repo = github_con.get_repo(sdk_pr_target_repo_id)

    if '/' in sdk_git_id:
        sdk_git_owner = sdk_git_id.split('/')[0]
        _LOGGER.info("Do the PR from %s", sdk_git_owner)
        head_name = "{}:{}".format(sdk_git_owner, branch_name)
    else:
        head_name = branch_name
        sdk_git_repo = github_con.get_repo(sdk_git_id)
        sdk_git_owner = sdk_git_repo.owner.login

    try:
        github_pr = sdk_pr_target_repo.create_pull(
            title='Automatic PR from {}'.format(branch_name),
            body=pr_body,
            head=head_name,
            base=base_branch
        )
    except GithubException as err:
        if err.status == 422 and err.data['errors'][0].get('message', '').startswith('A pull request already exists'):
            matching_pulls = sdk_pr_target_repo.get_pulls(base=base_branch, head=sdk_git_owner+":"+head_name)
            matching_pull = matching_pulls[0]
            _LOGGER.info('PR already exists: %s', matching_pull.html_url)
            return matching_pull
        raise
    _LOGGER.info("Made PR %s", github_pr.html_url)
    return github_pr