MCPcopy Create free account
hub / github.com/HKUDS/AutoAgent / submit_pull_request

Function submit_pull_request

autoagent/tools/github_ops.py:91–119  ·  view source on GitHub ↗

Submit a Pull Request Args: title: PR title body: PR description target_branch: target branch

(title: str, body: str, target_branch: str)

Source from the content-addressed store, hash-verified

89
90@register_tool("submit_pull_request")
91def submit_pull_request(title: str, body: str, target_branch: str):
92 """
93 Submit a Pull Request
94
95 Args:
96 title: PR title
97 body: PR description
98 target_branch: target branch
99 """
100 # initialize GitHub client
101 github = GitHubClient(GITHUB_AI_TOKEN)
102
103 # check authentication
104 auth_result = github.check_auth()
105 if auth_result['status'] != 0:
106 return auth_result
107
108 # create a pull request
109 pr_result = github.create_pull_request(
110 repo="tjb-tech/autoagent",
111 title=title,
112 body=body,
113 head=get_current_branch(),
114 base=target_branch
115 )
116 if pr_result['status'] == 0:
117 return f"PR created successfully: {json.dumps(pr_result, indent=4)}"
118 else:
119 return f"PR creation failed: {json.dumps(pr_result, indent=4)}"
120
121# def create_pull_request(title, body, target_branch):
122# """

Callers 1

github_ops.pyFile · 0.85

Calls 4

check_authMethod · 0.95
create_pull_requestMethod · 0.95
GitHubClientClass · 0.90
get_current_branchFunction · 0.85

Tested by

no test coverage detected