in migration/src/github_issues_util.py [0:0]
def create_issue(token: str, repo: str, title: str, body: str, logger: Logger) -> Optional[tuple[str, int]]:
url = GITHUB_API_BASE + f"/repos/{repo}/issues"
headers = {"Authorization": f"token {token}", "Accept": "application/vnd.github.v3+json"}
data = {"title": title, "body": body}
res = requests.post(url, headers=headers, json=data)
time.sleep(INTERVAL_IN_SECONDS)
if res.status_code != 201:
logger.error(f"Failed to create issue; status_code={res.status_code}, message={res.text}")
return None
html_url = res.json()["html_url"]
number = res.json()["number"]
return (html_url, number)