Skip to content

Commit

Permalink
fix: fixed API that scans repositories for private users (CycodeLabs#175
Browse files Browse the repository at this point in the history
)
  • Loading branch information
elad-pticha authored Mar 19, 2024
1 parent 23f9ed8 commit 7cdd9d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/downloader/gh_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
+ "/search/repositories?q={query}&sort=stars&order=desc&per_page=100&page={page}"
)
ACCOUNT_INFO_URL = BASE_URL + "/users/{account_name}"
USER_REPOSITORY_URL = BASE_URL + "/users/{user_name}/repos?per_page=100&page={page}"
USER_REPOSITORY_URL = BASE_URL + "/user/repos?type=owner&per_page=100&page={page}"
ORGANIZATION_REPOSITORY_URL = (
BASE_URL + "/orgs/{organization_name}/repos?per_page=100&page={page}"
)
Expand Down Expand Up @@ -180,7 +180,7 @@ def get_user_repository(user_name: str, page: int) -> list[dict]:
headers["Authorization"] = f"Token {Config.github_token}"

r = get(
USER_REPOSITORY_URL.format(user_name=user_name, page=page),
USER_REPOSITORY_URL.format(page=page),
headers=headers,
)
if r.status_code != HTTPStatus.OK:
Expand Down

0 comments on commit 7cdd9d4

Please sign in to comment.