Skip to content

Commit 75131b5

Browse files
allow git PAT to start with gth_
1 parent 86eab77 commit 75131b5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/gitingest/cloning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def clone_repo(config: CloneConfig, token: Optional[str] = None) -> None:
3333
token : str, optional
3434
GitHub personal-access token (PAT). Needed when *source* refers to a
3535
**private** repository. Can also be set via the ``GITHUB_TOKEN`` env var.
36-
Must start with 'github_pat_' for GitHub repositories.
36+
Must start with 'github_pat_' or 'gph_' for GitHub repositories.
3737
3838
Raises
3939
------

src/gitingest/utils/git_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
from typing import List, Optional, Tuple
77

8-
GITHUB_PAT_PATTERN = r"^github_pat_[A-Za-z0-9_]{40,}$"
8+
GITHUB_PAT_PATTERN = r"^(?:github_pat_|gph_)[A-Za-z0-9_]{40,}$"
99

1010

1111
async def run_command(*args: str) -> Tuple[bytes, bytes]:
@@ -261,6 +261,6 @@ def validate_github_token(token: str) -> None:
261261
"""
262262
if not re.match(GITHUB_PAT_PATTERN, token):
263263
raise ValueError(
264-
"Invalid GitHub token format. Token should start with 'github_pat_' "
264+
"Invalid GitHub token format. Token should start with 'github_pat_' or 'gph_' "
265265
"followed by at least 40 characters of letters, numbers, and underscores."
266266
)

0 commit comments

Comments
 (0)