Get details for a specific commit by its SHA. If branch is specified, it's used for validation but not in the URL.
(
self,
user_access_token: str,
repo_id: int,
commit_sha: str,
branch: str | None = None,
)
| 237 | return response.json() |
| 238 | |
| 239 | async def get_repository_commit( |
| 240 | self, |
| 241 | user_access_token: str, |
| 242 | repo_id: int, |
| 243 | commit_sha: str, |
| 244 | branch: str | None = None, |
| 245 | ) -> dict: |
| 246 | """ |
| 247 | Get details for a specific commit by its SHA. |
| 248 | If branch is specified, it's used for validation but not in the URL. |
| 249 | """ |
| 250 | url = f"https://api.github.com/repositories/{repo_id}/commits/{commit_sha}" |
| 251 | |
| 252 | params = {} |
| 253 | if branch: |
| 254 | params["ref"] = branch |
| 255 | |
| 256 | response = httpx.get( |
| 257 | url, headers={"Authorization": f"Bearer {user_access_token}"}, params=params |
| 258 | ) |
| 259 | response.raise_for_status() |
| 260 | return response.json() |
| 261 | |
| 262 | async def get_installation(self, installation_id: str) -> dict: |
| 263 | """Get installation details from GitHub.""" |
no outgoing calls
no test coverage detected