MCPcopy
hub / github.com/pydantic/pydantic / open_pull_request

Function open_pull_request

release/push.py:61–78  ·  view source on GitHub ↗

Open a pull request on GitHub.

(rl_version: str)

Source from the content-addressed store, hash-verified

59
60
61def open_pull_request(rl_version: str):
62 """Open a pull request on GitHub."""
63 url = f'https://api.github.com/repos/{REPO}/pulls'
64 headers = {'Authorization': f'token {GITHUB_TOKEN}'}
65 data = {
66 'title': f'Release v{rl_version}',
67 'head': f'release/v{rl_version}',
68 'base': 'main',
69 'body': f'Bumping version to v{rl_version}.',
70 }
71 response = requests.post(url, json=data, headers=headers, timeout=10)
72 try:
73 response.raise_for_status()
74 except requests.exceptions.HTTPError as e:
75 print(f'HTTP error occurred: {e}')
76 print(f'Response content: {response.content.decode()}')
77 raise e
78 return response.json()['html_url']
79
80
81def create_version_tag(rl_version: str):

Callers 1

push.pyFile · 0.85

Calls 3

printFunction · 0.85
decodeMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected