本文整理匯總了Python中github.GitHub.create_pull_request方法的典型用法代碼示例。如果您正苦於以下問題:Python GitHub.create_pull_request方法的具體用法?Python GitHub.create_pull_request怎麽用?Python GitHub.create_pull_request使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.GitHub
的用法示例。
在下文中一共展示了GitHub.create_pull_request方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: pull_request
# 需要導入模塊: from github import GitHub [as 別名]
# 或者: from github.GitHub import create_pull_request [as 別名]
def pull_request():
args = _make_argparser().parse_args()
if args.debug:
logging.disable(logging.NOTSET)
try:
git = Git()
except GitException as ex:
print('ERROR: ' + ex.message)
return 1
config = CmdprConfig(CONFIG)
try:
github = GitHub(get_token(config))
base = args.base[0]
title, body = '', ''
if args.message is None:
title, body = create_request_title(git.get_commits(base))
else:
title = args.message[0]
if title is None:
print('ERROR: There\'s no title for pull request')
return 1
repo_info = git.get_repo_info()
bug_tracker = config.get("bug_tracker")
if bug_tracker:
body = bug_tracker.format(task=repo_info['branch'])
pr_url = github.create_pull_request(repo_info, title, base, body)
print(pr_url)
except GitHubException as ex:
print('ERROR: ' + ex.message)
return 1