fix: added private label to user's private repository while logging

This commit is contained in:
Anmol Singh
2023-02-25 01:20:33 +05:30
parent 5c3b1ed91b
commit c8ef0e49be
2 changed files with 3 additions and 1 deletions

View File

@@ -69,6 +69,7 @@ GITHUB_API_QUERIES = {
owner { owner {
login login
} }
isPrivate
} }
pageInfo { pageInfo {
endCursor endCursor

View File

@@ -21,7 +21,8 @@ async def calculate_yearly_commit_data(repositories: Dict) -> Dict:
total = len(repositories["data"]["user"]["repositories"]["nodes"]) total = len(repositories["data"]["user"]["repositories"]["nodes"])
for ind, repo in enumerate(repositories["data"]["user"]["repositories"]["nodes"]): for ind, repo in enumerate(repositories["data"]["user"]["repositories"]["nodes"]):
if repo["name"] not in EM.IGNORED_REPOS: if repo["name"] not in EM.IGNORED_REPOS:
DBM.i(f"\t{ind + 1}/{total} Retrieving repo: {repo['owner']['login']}/{repo['name']}") repo_name = "private" if repo["isPrivate"] else repo['owner']['login'] + "/" + repo['name']
DBM.i(f"\t{ind + 1}/{total} Retrieving repo: {repo_name}")
await update_yearly_data_with_commit_stats(repo, yearly_data) await update_yearly_data_with_commit_stats(repo, yearly_data)
DBM.g("Yearly commit data calculated!") DBM.g("Yearly commit data calculated!")
return yearly_data return yearly_data