Open a pull request on GitHub.
(rl_version: str)
| 59 | |
| 60 | |
| 61 | def 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 | |
| 81 | def create_version_tag(rl_version: str): |