def create_comment()

in migration/src/github_issues_util.py [0:0]


def create_comment(token: str, repo: str, issue_number: int, body: str, logger: Logger) -> Optional[int]:
    url = GITHUB_API_BASE + f"/repos/{repo}/issues/{issue_number}/comments"
    headers = {"Authorization": f"token {token}", "Accept": "application/vnd.github.v3+json"}
    data = {"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 comment; status_code={res.status_code}, message={res.text}")
        return None
    id = res.json()["id"]
    return id