Validate the format of a GitHub Personal Access Token. Parameters ---------- token : str GitHub personal access token (PAT) for accessing private repositories. Raises ------ InvalidGitHubTokenError If the token format is invalid.
(token: str)
| 311 | |
| 312 | |
| 313 | def validate_github_token(token: str) -> None: |
| 314 | """Validate the format of a GitHub Personal Access Token. |
| 315 | |
| 316 | Parameters |
| 317 | ---------- |
| 318 | token : str |
| 319 | GitHub personal access token (PAT) for accessing private repositories. |
| 320 | |
| 321 | Raises |
| 322 | ------ |
| 323 | InvalidGitHubTokenError |
| 324 | If the token format is invalid. |
| 325 | |
| 326 | """ |
| 327 | if not re.fullmatch(_GITHUB_PAT_PATTERN, token): |
| 328 | raise InvalidGitHubTokenError |
| 329 | |
| 330 | |
| 331 | async def checkout_partial_clone(config: CloneConfig, token: str | None) -> None: |
no outgoing calls