GitStats
GitStats copied to clipboard
Generate daily updated customizable visualizations of user and repository statistics from the GitHub GraphQL and REST APIs using GitHub Actions and Secrets
📈 GitHub Stats Visualization 🔭
Generate daily updated visualizations of user and repository statistics from the GitHub GraphQL and REST APIs using GitHub Actions and Secrets. Customizable visualizations support dark and light mode and can adapt to device sizes.
A modification of
jstrieb/github-stats
visualizations with new and improved statistics and more options!
Note: my 'Avg collaborative contributions' stats is customized to only consider collaborative uni project repos
:rocket: Instructions
Click drop-down to view step-by-step instructions for generating your own GitHub statistics visualizations
Copy Repository
- Click either link to start generating your own GitHub statistic visualizations:
-
Generate your own copy of this repository without the commit history
- Note: the first GitHub Actions workflow initiated at creation of the copied repository is expected to fail
-
Fork a copy of this repository with the commit history configured to sync changes
-
Note: this copies all branches including the
action_branch
with statistics, but this can be overwritten
-
Note: this copies all branches including the
-
Generate your own copy of this repository without the commit history
Generate a New Personal Access Token
- Generate a personal access token by following these steps:
- If you are logged in, click this link to: generate a new "classic" token
- Otherwise, to learn how to generate a personal access token: read these instructions
- Ensure it is a "classic" token being generated and not a "fine-grained" token
- Name the token
- Select your preferred 'Expiration' date
- Select
repo
for 'Full control of private repositories' - Select
read:user
to 'Read only ALL user profile data' - Click the 'Generate token' button
- Copy the generated token - there is only one opportunity provided for this
- If you are logged in, click this link to: generate a new "classic" token
Create ACCESS_TOKEN Secret
- Create a repository secret for the personal access token by following these steps:
- If this is your copy of the repository, click this link to: create a new secret
- Otherwise, go to repository Settings, click the Secrets option, then click New repository secret
- Name the new secret:
ACCESS_TOKEN
- Enter the generated personal access token as the 'Value'
- If this is your copy of the repository, click this link to: create a new secret
Run GitHub Actions Workflow
- Manually generate GitHub statistics visualizations:
- This can be done using any of the following two GitHub Actions workflows:
- For the first time, or to reset stored statistics (although this is done with every push to the main):
- Click the link to: go to the Generate Git Stats Images GitHub Actions workflow
This is required if the
actions_branch
branch is not created, as it is created when run - Otherwise, for updating generated statistics visualizations (although this is automatically done daily):
- Click the link to: go to the Auto Update Stats Images GitHub Actions workflow
This requires the
actions_branch
branch to first be created with generated statistics visualizations
- For the first time, or to reset stored statistics (although this is done with every push to the main):
- With the GitHub Actions page open, click the 'Run workflow' dropdown menu button
- Select
Branch: main
from the 'Use workflow from' dropdown list - Click the 'Run workflow' button
- Note: this could take some time
- This can be done using any of the following two GitHub Actions workflows:
View Generated Statistics
- Following the successful completion of a workflow, generated statistics visualizations can be viewed:
- In the
generated_images
directory in theactions_branch
branch with the following image links:- Language statistics
- Overview statistics
- In the
Display Generated Statistics
- To display the generated statistics, static URLs can be used for images that are updated daily:
- For generated language statistics visualizations (replacing
<username>
with your GitHub username):
![](https://raw.githubusercontent.com/<username>/GitStats/actions_branch/generated_images/languages.svg)
- For generated overview statistic visualizations (replacing
<username>
with your GitHub username):
![](https://raw.githubusercontent.com/<username>/GitStats/actions_branch/generated_images/overview.svg)
- For generated language statistics visualizations (replacing
:closed_lock_with_key: Options
Click drop-down to view optional repository Secrets for customizing GitHub statistic visualizations
-
Optional Secret Name:
EXCLUDED
For excluding repositories from being included entirely in 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
-
- enter Value in the following format (separated by commas):
-
Optional Secret Name:
ONLY_INCLUDED
For ONLY including repositories in the generated statistic visualizations
- such as when there are fewer repositories to include than to exclude
Instructions:
- enter Value in the following format (separated by commas):
-
[owner/repo],[owner/repo],...,[owner/repo]
-
- example:
-
R055A/GitStats,R055A/R055A
-
-
Optional Secret Name:
EXCLUDED_LANGS
For excluding undesired languages from being included in the generated statistic visualizations
Instructions:
- enter Value in the following format (separated by commas):
-
[language],[language],...,[language]
-
- example:
-
HTML,Jupyter Notebook,Makefile,Dockerfile
-
- enter Value in the following format (separated by commas):
-
Optional Secret Name:
INCLUDE_FORKED_REPOS
Boolean option for including forked repositories in the generated statistic visualizations. These could repeat statistical calculations
-
false
by default
Instructions:
- enter Value in the following format:
-
<boolean>
-
- examples:
-
true
-
-
-
Optional Secret Name:
EXCLUDE_CONTRIB_REPOS
Boolean option for excluding non-owned repositories contributed to in the generated statistic visualizations
-
false
by default
Instructions:
- enter Value in the following format:
-
<boolean>
-
- examples:
-
true
-
-
-
Optional Secret Name:
EXCLUDE_ARCHIVE_REPOS
Boolean option for excluding archived repositories in the generated statistic visualizations
-
false
by default
Instructions:
- enter Value in the following format:
-
<boolean>
-
- examples:
-
true
-
-
-
Optional Secret Name:
EXCLUDE_PRIVATE_REPOS
Boolean option for excluding private repositories in the generated statistic visualizations
- for when you want to keep those secrets locked away from prying eyes
-
false
by default
Instructions:
- enter Value in the following format:
-
<boolean>
-
- examples:
-
true
-
-
Optional Secret Name:
EXCLUDE_PUBLIC_REPOS
Boolean option for excluding public repositories in the generated statistic visualizations
-
false
by default
Instructions:
- enter Value in the following format:
-
<boolean>
-
- examples:
-
true
-
-
-
Optional Secret Name:
MORE_REPOS
For including repositories that are otherwise not included in generated statistic visualizations when scraping by username
- such as repositories imported from, say, GitLab - hint: add emails used in imported repo commits to profile settings
Instructions:
- enter Value in the following format (separated by commas):
-
[owner/repo],[owner/repo],...,[owner/repo]
-
- example:
-
R055A/GitStats,R055A/R055A
-
-
Optional Secret Name:
MORE_COLLABS
For adding a constant value to the generated repository collaborators statistic
- such as for collaborators that are otherwise not represented
Instructions:
- enter Value in the following format:
-
<int>
-
- example:
-
4
-
-
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
- contributions are made to a collaborative repo, but it is not one of your projects (open-source typo fix, etc)
- someone deletes and re-adds the entire codebase a few times too many
- your or someone else's performance is not fairly represented - missing data bias
- pirates, ninjas, etc.
Instructions:
- enter Value in the following format (separated by commas):
-
[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
-
- for example, such as for when
-
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
- nobody even bothered to join the repository as a collaborator let alone contribute anything
- the repository is imported and because it is ghosted there are no other contributions and, thus, none of the other collaborators are represented in the scraping
Instructions:
- enter Value in the following format (separated by commas):
-
[owner/repo],[owner/repo],...,[owner/repo]
-
- example:
-
imported_ghosted/large_A+_collab_project,slave_trade/larger_A++_project
-
- for example, such as when
-
Optional Secret Name:
STORE_REPO_VIEWS
Boolean for storing generated repository view statistic visualization data beyond the 14 day-limit GitHub API allows
-
true
by default
Instructions:
- enter Value in the following format:
-
<boolean>
-
- examples:
-
false
-
-
-
Optional Secret Name:
REPO_VIEWS
For adding a constant value to the generated repository view statistics
- such as for when the stored data is reset or when importing stat data from elsewhere
- requires being removed within 14 days after the first workflow is run (with
LAST_VIEWED
) - requires corresponding
LAST_VIEWED
andFIRST_VIEWED
Secrets
Instructions:
- enter Value in the following format:
-
<int>
-
- example:
-
5000
-
-
Optional Secret Name:
LAST_VIEWED
For updating the date the generated repository view statistics data is added to storage from
- such as for when the stored data is reset or when importing stat data from elsewhere
- requires being removed within 14 days after the first workflow is run (with
REPO_VIEWS
) - may require corresponding
REPO_VIEWS
andFIRST_VIEWED
Secrets
Instructions:
- enter Value in the following format:
-
YYYY-MM-DD
-
- example:
-
2020-10-01
-
-
Optional Secret Name:
FIRST_VIEWED
For updating the 'as of' date the generated repository view statistics data is stored from
- such as for when the stored data is reset or when importing stat data from elsewhere
- may require corresponding
REPO_VIEWS
andLAST_VIEWED
Secrets
Instructions:
- enter Value in the following format:
-
YYYY-MM-DD
-
- example:
-
2021-03-31
-
:green_heart: Support the Project
There are a few things you can do to support the project:
- ✨ Star this repository (and/or 🌠 star
jstrieb/github-stats
and 🔭 followjstrieb
for more) - :memo: Report any bugs :bug:, glitches, or errors that you find :monocle_face:
- :money_with_wings: Spare a donation to a worthy cause 🥹