MCPcopy
hub / github.com/pydantic/pydantic / create_github_release

Function create_github_release

release/push.py:87–112  ·  view source on GitHub ↗

Create a new release on GitHub.

(new_version: str, notes: str)

Source from the content-addressed store, hash-verified

85
86
87def create_github_release(new_version: str, notes: str):
88 """Create a new release on GitHub."""
89 url = f'https://api.github.com/repos/{REPO}/releases'
90
91 data = {
92 'tag_name': f'v{new_version}',
93 'name': f'v{new_version}',
94 'body': notes,
95 'draft': True,
96 }
97
98 response = requests.post(
99 url,
100 headers={
101 'Authorization': f'Bearer {GITHUB_TOKEN}',
102 'Accept': 'application/vnd.github+json',
103 },
104 json=data,
105 timeout=10,
106 )
107 try:
108 response.raise_for_status()
109 except requests.exceptions.HTTPError as e:
110 print(f'HTTP error occurred: {e}')
111 print(f'Response content: {response.content.decode()}')
112 raise e
113
114
115def create_github_release_draft(rl_version: str, rl_release_notes: str):

Callers

nothing calls this directly

Calls 2

printFunction · 0.85
decodeMethod · 0.45

Tested by

no test coverage detected