NotDarkn / github-stats

Better GitHub statistics images for @notdarkn, with stats from private repos too

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate visualizations of GitHub user and repository statistics with GitHub Actions. Visualizations can include data for both private repositories, and for repositories you have contributed to, but do not own.

Generated images automatically switch between GitHub light theme and GitHub dark theme.

Installation

  1. Create a personal access token (not the default GitHub Actions token) using the instructions here. Personal access token must have permissions: read:user and repo. Copy the access token when it is generated – if you lose it, you will have to regenerate the token.
    • Some users are reporting that it can take a few minutes for the personal access token to work. For more, see #30.
  2. Create a copy of this repository by clicking here. Note: this is not the same as forking a copy because it copies everything fresh, without the huge commit history.
  3. Go to the "Secrets" page of your copy of the repository. If this is the README of your copy, click this link to go to the "Secrets" page. Otherwise, go to the "Settings" tab of the newly-created repository and go to the "Secrets" page (bottom left).
  4. Create a new secret with the name ACCESS_TOKEN and paste the copied personal access token as the value.
  5. It is possible to change the type of statistics reported by adding other repository secrets.
    • To ignore certain repos, add them (in owner/name format e.g., jstrieb/github-stats) separated by commas to a new secret—created as before—called EXCLUDED.
    • To ignore certain languages, add them (separated by commas) to a new secret called EXCLUDED_LANGS. For example, to exclude HTML and TeX you could set the value to html,tex.
    • To show statistics only for "owned" repositories and not forks with contributions, add an environment variable (under the env header in the main workflow) called EXCLUDE_FORKED_REPOS with a value of true.
    • These other values are added as secrets by default to prevent leaking information about private repositories. If you're not worried about that, you can change the values directly in the Actions workflow itself.
  6. Go to the Actions Page and press "Run Workflow" on the right side of the screen to generate images for the first time.
    • The images will be automatically regenerated every 24 hours, but they can be regenerated manually by running the workflow this way.
  7. Take a look at the images that have been created in the generated folder.
  8. To add your statistics to your GitHub Profile README, copy and paste the following lines of code into your markdown content. Change the username value to your GitHub username.
    ![](https://raw.githubusercontent.com/username/github-stats/master/generated/overview.svg#gh-dark-mode-only)
    ![](https://raw.githubusercontent.com/username/github-stats/master/generated/overview.svg#gh-light-mode-only)
    ![](https://raw.githubusercontent.com/username/github-stats/master/generated/languages.svg#gh-dark-mode-only)
    ![](https://raw.githubusercontent.com/username/github-stats/master/generated/languages.svg#gh-light-mode-only)
  9. Link back to this repository so that others can generate their own statistics images.
  10. Star this repo if you like it!

Related Projects

About

Better GitHub statistics images for @notdarkn, with stats from private repos too

License:GNU General Public License v3.0


Languages

Language:Python 100.0%