Skip to content
This repository was archived by the owner on Dec 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/auto_update_stat_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ jobs:
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXCLUDED: ${{ secrets.EXCLUDED }}
EXCLUDED_REPOS: ${{ secrets.EXCLUDED_REPOS }}
EXCLUDED_OWNERS: ${{ secrets.EXCLUDED_OWNERS }}
EXCLUDED_LANGS: ${{ secrets.EXCLUDED_LANGS }}
EXCLUDED_REPO_LANGS: ${{ secrets.EXCLUDED_REPO_LANGS }}
IS_INCLUDE_FORKED_REPOS: ${{ secrets.IS_INCLUDE_FORKED_REPOS }}
Expand All @@ -71,10 +72,14 @@ jobs:
IS_STORE_REPO_VIEWS: ${{ secrets.IS_STORE_REPO_VIEWS }}
MORE_COLLABS: ${{ secrets.MORE_COLLABS }}
MORE_REPOS: ${{ secrets.MORE_REPOS }}
ONLY_INCLUDED: ${{ secrets.ONLY_INCLUDED }}
ONLY_INCLUDED_REPOS: ${{ secrets.ONLY_INCLUDED_REPOS }}
ONLY_INCLUDED_OWNERS: ${{ secrets.ONLY_INCLUDED_OWNERS }}
ONLY_INCLUDED_COLLAB_REPOS: ${{ secrets.ONLY_INCLUDED_COLLAB_REPOS }}
ONLY_INCLUDED_COLLAB_REPO_OWNERS: ${{ secrets.ONLY_INCLUDED_COLLAB_REPO_OWNERS }}
EXCLUDED_COLLAB_REPOS: ${{ secrets.EXCLUDED_COLLAB_REPOS }}
EXCLUDED_COLLAB_REPO_OWNERS: ${{ secrets.EXCLUDED_COLLAB_REPO_OWNERS }}
MORE_COLLAB_REPOS: ${{ secrets.MORE_COLLAB_REPOS }}
MORE_COLLAB_REPO_OWNERS: ${{ secrets.MORE_COLLAB_REPO_OWNERS }}

# Commits all changed files to the repository
- name: Commit to the repo
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/non_auto_generate_stat_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ jobs:
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXCLUDED: ${{ secrets.EXCLUDED }}
EXCLUDED_REPOS: ${{ secrets.EXCLUDED_REPOS }}
EXCLUDED_OWNERS: ${{ secrets.EXCLUDED_OWNERS }}
EXCLUDED_LANGS: ${{ secrets.EXCLUDED_LANGS }}
EXCLUDED_REPO_LANGS: ${{ secrets.EXCLUDED_REPO_LANGS }}
IS_INCLUDE_FORKED_REPOS: ${{ secrets.IS_INCLUDE_FORKED_REPOS }}
Expand All @@ -74,10 +75,14 @@ jobs:
IS_STORE_REPO_VIEWS: ${{ secrets.IS_STORE_REPO_VIEWS }}
MORE_COLLABS: ${{ secrets.MORE_COLLABS }}
MORE_REPOS: ${{ secrets.MORE_REPOS }}
ONLY_INCLUDED: ${{ secrets.ONLY_INCLUDED }}
ONLY_INCLUDED_REPOS: ${{ secrets.ONLY_INCLUDED_REPOS }}
ONLY_INCLUDED_OWNERS: ${{ secrets.ONLY_INCLUDED_OWNERS }}
ONLY_INCLUDED_COLLAB_REPOS: ${{ secrets.ONLY_INCLUDED_COLLAB_REPOS }}
ONLY_INCLUDED_COLLAB_REPO_OWNERS: ${{ secrets.ONLY_INCLUDED_COLLAB_REPO_OWNERS }}
EXCLUDED_COLLAB_REPOS: ${{ secrets.EXCLUDED_COLLAB_REPOS }}
EXCLUDED_COLLAB_REPO_OWNERS: ${{ secrets.EXCLUDED_COLLAB_REPO_OWNERS }}
MORE_COLLAB_REPOS: ${{ secrets.MORE_COLLAB_REPOS }}
MORE_COLLAB_REPO_OWNERS: ${{ secrets.MORE_COLLAB_REPO_OWNERS }}

# Commits all changed files to the repository
- name: Commit to the repo
Expand Down
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,23 @@ Generate regularly updated visualizations of user and repository statistics from
<summary>Click drop-down to view optional repository Secrets for customizing GitHub statistic visualizations
</summary>

* ### Optional Secret *Name*: `EXCLUDED`
For excluding repositories from being included entirely in the generated statistic visualizations.
* ### Optional Secret *Name*: `EXCLUDED_REPOS`
For excluding repositories from the generated statistic visualizations.

**Instructions**:
* enter *Value* in the following format (separated by commas):
* `[owner/repo],[owner/repo],...,[owner/repo]`
* example:
* `jstrieb/github-stats,rahul-jha98/github-stats-transparent,idiotWu/stats`
* ### Optional Secret *Name*: `ONLY_INCLUDED`
* ### Optional Secret *Name*: `EXCLUDED_OWNERS`
For excluding repositories associated with (user/organisation) owners from the generated statistic visualizations.

**Instructions**:
* enter *Value* in the following format (separated by commas):
* `[owner],[owner],...,[owner]`
* example:
* `R055A,University-Project-Repos`
* ### Optional Secret *Name*: `ONLY_INCLUDED_REPOS`
For **ONLY** including repositories in the generated statistic visualizations
- such as when there are fewer repositories to include than to exclude

Expand All @@ -118,6 +126,15 @@ Generate regularly updated visualizations of user and repository statistics from
* `[owner/repo],[owner/repo],...,[owner/repo]`
* example:
* `R055A/GitStats,R055A/R055A`
* ### Optional Secret *Name*: `ONLY_INCLUDED_OWNERS`
For **ONLY** including repositories associated with (user/organisation) owners in the generated statistic visualizations
- such as when there are fewer owners to include than to exclude

**Instructions**:
* enter *Value* in the following format (separated by commas):
* `[owner],[owner],...,[owner]`
* example:
* `R055A,University-Project-Repos`
* ### Optional Secret *Name*: `EXCLUDED_LANGS`
For excluding undesired languages from being included in the generated statistic visualizations

Expand Down Expand Up @@ -208,6 +225,15 @@ Generate regularly updated visualizations of user and repository statistics from
* `[owner/repo],[owner/repo],...,[owner/repo]`
* example:
* `R055A/UniversityProject-A,R055A/UniversityProject-B`
* ### Optional Secret *Name*: `ONLY_INCLUDED_COLLAB_REPO_OWNERS`
For **ONLY** including collaborative repositories associated with owner(s) in the generated average contribution statistics calculations
- such as when there are fewer collaborative repository owners to include than to exclude

**Instructions**:
* enter *Value* in the following format (separated by commas):
* `[owner],[owner],...,[owner]`
* example:
* `R055A,University-Project-Repos`
* ### Optional Secret *Name*: `EXCLUDED_COLLAB_REPOS`
For excluding collaborative repositories from being included in the average contribution statistics calculations
- for example, such as for when
Expand All @@ -221,6 +247,14 @@ Generate regularly updated visualizations of user and repository statistics from
* `[owner/repo],[owner/repo],...,[owner/repo]`
* example:
* `tera_open_source/bit_typo_fix,peer_repo/missing_or_no_git_co_author_credit,dude_collab/email_not_reg_on_github,dog_ate/my_repo,mars/attacks`
* ### Optional Secret *Name*: `EXCLUDED_COLLAB_REPO_OWNERS`
For excluding collaborative repositories associated with owner(s) from being included in the average contribution statistics calculations

**Instructions**:
* enter *Value* in the following format (separated by commas):
* `[owner],[owner],...,[owner]`
* example:
* `R055A,University-Project-Repos`
* ### Optional Secret *Name*: `MORE_COLLAB_REPOS`
For including collaborative repositories that are otherwise not included in the average contribution statistics calculations
- for example, such as when
Expand All @@ -232,6 +266,14 @@ Generate regularly updated visualizations of user and repository statistics from
* `[owner/repo],[owner/repo],...,[owner/repo]`
* example:
* `imported_ghosted/large_A+_collab_project,slave_trade/larger_A++_project`
* ### Optional Secret *Name*: `MORE_COLLAB_REPO_OWNERS`
For including collaborative repositories associated with owner(s) that are otherwise not included in the average contribution statistics calculations

**Instructions**:
* enter *Value* in the following format (separated by commas):
* `[owner],[owner],...,[owner]`
* example:
* `R055A,University-Project-Repos`
* ### Optional Secret *Name*: `IS_STORE_REPO_VIEWS`
Boolean for storing generated repository view statistic visualization data beyond the 14 day-limit GitHub API allows
- `true` by default
Expand Down
49 changes: 47 additions & 2 deletions src/env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def __init__(
self,
username: str,
access_token: str,
exclude_repos: Optional[str] = getenv("EXCLUDED"),
exclude_repos: Optional[str] = getenv("EXCLUDED_REPOS"),
exclude_owners: Optional[str] = getenv("EXCLUDED_OWNERS"),
exclude_langs: Optional[str] = getenv("EXCLUDED_LANGS"),
exclude_repo_langs: Optional[str] = getenv("EXCLUDED_REPO_LANGS"),
is_include_forked_repos: str = getenv("IS_INCLUDE_FORKED_REPOS"),
Expand All @@ -32,12 +33,20 @@ def __init__(
is_store_repo_view_count: str = getenv("IS_STORE_REPO_VIEWS"),
more_collaborators: Optional[str] = getenv("MORE_COLLABS"),
manually_added_repos: Optional[str] = getenv("MORE_REPOS"),
only_included_repos: Optional[str] = getenv("ONLY_INCLUDED"),
only_included_repos: Optional[str] = getenv("ONLY_INCLUDED_REPOS"),
only_included_owners: Optional[str] = getenv("ONLY_INCLUDED_OWNERS"),
only_included_collab_repos: Optional[str] = getenv(
"ONLY_INCLUDED_COLLAB_REPOS"
),
only_included_collab_repo_owners: Optional[str] = getenv(
"ONLY_INCLUDED_COLLAB_REPO_OWNERS"
),
exclude_collab_repos: Optional[str] = getenv("EXCLUDED_COLLAB_REPOS"),
exclude_collab_repo_owners: Optional[str] = getenv(
"EXCLUDED_COLLAB_REPO_OWNERS"
),
more_collab_repos: Optional[str] = getenv("MORE_COLLAB_REPOS"),
more_collab_repo_owners: Optional[str] = getenv("MORE_COLLAB_REPO_OWNERS"),
) -> None:
self.__db: GitRepoStatsDB = GitRepoStatsDB()

Expand All @@ -49,6 +58,11 @@ def __init__(
else:
self.exclude_repos = {x.strip() for x in exclude_repos.split(",")}

if exclude_owners is None:
self.exclude_owners: set[str] = set()
else:
self.exclude_owners = {x.strip() for x in exclude_owners.split(",")}

if exclude_langs is None:
self.exclude_langs: set[str] = set()
else:
Expand Down Expand Up @@ -154,25 +168,56 @@ def __init__(
x.strip() for x in only_included_repos.split(",")
}

if only_included_owners is None or only_included_owners == "":
self.only_included_owners: set[str] = set()
else:
self.only_included_owners = {
x.strip() for x in only_included_owners.split(",")
}

if only_included_collab_repos is None or only_included_collab_repos == "":
self.only_included_collab_repos: set[str] = set()
else:
self.only_included_collab_repos = {
x.strip() for x in only_included_collab_repos.split(",")
}

if (
only_included_collab_repo_owners is None
or only_included_collab_repo_owners == ""
):
self.only_included_collab_repo_owners: set[str] = set()
else:
self.only_included_collab_repo_owners = {
x.strip() for x in only_included_collab_repo_owners.split(",")
}

if exclude_collab_repos is None:
self.exclude_collab_repos: set[str] = set()
else:
self.exclude_collab_repos = {
x.strip() for x in exclude_collab_repos.split(",")
}

if exclude_collab_repo_owners is None:
self.exclude_collab_repo_owners: set[str] = set()
else:
self.exclude_collab_repo_owners = {
x.strip() for x in exclude_collab_repo_owners.split(",")
}

if more_collab_repos is None:
self.more_collab_repos: set[str] = set()
else:
self.more_collab_repos = {x.strip() for x in more_collab_repos.split(",")}

if more_collab_repo_owners is None:
self.more_collab_repo_owners: set[str] = set()
else:
self.more_collab_repo_owners = {
x.strip() for x in more_collab_repo_owners.split(",")
}

self.pull_requests_count: int = self.__db.pull_requests
self.issues_count: int = self.__db.issues

Expand Down
14 changes: 13 additions & 1 deletion src/github_api_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,19 @@ async def query_rest(
)
return dict()

@staticmethod
def get_user() -> str:
"""
:return: GraphQL query with user login and name
"""
return """
{{
viewer {{
login
name
}}
}}"""

@staticmethod
def repos_overview(
contrib_cursor: Optional[str] = None, owned_cursor: Optional[str] = None
Expand All @@ -142,7 +155,6 @@ def repos_overview(
{{
viewer {{
login,
name,
repositories(
first: 100,
orderBy: {{
Expand Down
Loading