(
github_pat: str,
api_url: str,
owner: str,
repo: str,
title: str,
body: str,
)
| 97 | |
| 98 | |
| 99 | def create_github_issue( |
| 100 | github_pat: str, |
| 101 | api_url: str, |
| 102 | owner: str, |
| 103 | repo: str, |
| 104 | title: str, |
| 105 | body: str, |
| 106 | ) -> dict[str, Any]: |
| 107 | url = f"{api_url}repos/{owner}/{repo}/issues" |
| 108 | headers = { |
| 109 | "X-GitHub-Api-Version": GITHUB_API_VERSION, |
| 110 | "Accept": "application/vnd.github.v3+json", |
| 111 | "Authorization": f"token {github_pat}", |
| 112 | } |
| 113 | payload = {"title": title, "body": body} |
| 114 | response = requests.post( |
| 115 | url, json=payload, headers=headers, timeout=GITHUB_API_CALLS_TIMEOUT |
| 116 | ) |
| 117 | response.raise_for_status() |
| 118 | return response.json() # type: ignore[no-any-return] |
| 119 | |
| 120 | |
| 121 | def post_comment_to_github( |
no test coverage detected
searching dependent graphs…