https://github.com/datarootsio/github-stats-card
⭐️ a minimal but inclusive github stats badge ⭐️
https://github.com/datarootsio/github-stats-card
badge github profile readme stats
Last synced: 3 months ago
JSON representation
⭐️ a minimal but inclusive github stats badge ⭐️
- Host: GitHub
- URL: https://github.com/datarootsio/github-stats-card
- Owner: datarootsio
- License: mit
- Created: 2023-07-04T05:58:22.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-07T11:37:39.000Z (almost 2 years ago)
- Last Synced: 2025-04-01T15:53:47.785Z (3 months ago)
- Topics: badge, github, profile, readme, stats
- Language: TypeScript
- Homepage:
- Size: 3.44 MB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-stats-card
⭐️ *a minimal but inclusive github stats badge* ⭐️This is a GitHub Action that generated a stats badge that you can use on your GitHub [profile page](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/about-your-profile).
Why this stats badge generator you say? Because I noticed that people creating repos under organizations and receiving stars did not count towards their stars in most badge generation tools. And that's just a pity. So, in comes `github-stats-card`, a minimal but inclusive GitHub stats badge generator.
## Usage
The badge generator set up to works as a GitHub action. You can add it to the GH Actions workflow of your profile page as a step. Below an example workflow yaml.
```yaml
name: generate badge
on:
workflow_dispatch:
push:
schedule:
- cron: '0 0 * * 0'jobs:
update:
name: Update stats card
runs-on: ubuntu-latest
steps:
- uses: datarootsio/github-stats-card@v1
with:
username: bart6114
gh_token_stats: ${{ secrets.GH_PAT }}
gh_token_commits: ${{ secrets.GITHUB_TOKEN }}
badge_path: assets/badge.svg
header: "👋 hi i'm"
about: "Loves goblins, despises gnomes.\nEnjoys candlelit custard pudding."
theme: dark
commit_message: Badge generated by the treadmill bunnies.
```If the workflow has succesfully ran, it will create a badge under `assets/badge.svg`. That you can then include in your readme via ``.
## Themes
The following themes are available, see [configuration options](#configuration-options) on how to specify theme.
Want to create your own themes? Check out the `themes/` folder, it rather straightforward. PRs are very much welcome! ❤️
`theme: dark` 👇 (default theme)

`theme: cool-lake` 👇

`theme: neko-sleeps` 👇

`theme: jimmy-goes-fishing` 👇

`theme: pad-and-paper` 👇

`theme: retro-print` 👇

`theme: terminal-green` 👇

`theme: tropical-sunset` 👇

`theme: a-colibri-hums-while-the-dog-farts` 👇

`theme: grainy-dreams` 👇

`theme: hypnotoad` 👇

## Configuration options
`gh_token_stats`: token used for fetching user stats, typically a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) (PAT) with access to your personal and organisation repos
`gh_token_commits`: [optional] if you set this to `${{ secrets.GITHUB_TOKEN }}` it will use the github actions bot to commit the svg to the repo (if not set it will use your PAT)
`badge_path`: [optional] path of badge svg (defaults to `assets/badge.svg`)
`username`: your username
`header`: [optional] header to use for badge (defaults to: `👋 hi i'm`)
`about`: about me description to use for badge (use \n for newlines)
`commit_message`: [optional] commit message to use (defaults to `Update badge`)
`commit`: [optional] whether to commit badge to repo (defaults to `true`)
`exclude_repos`: [optional] comma separated list of repos to exclude from stats, will do regex based matching (e.g. 'datarootsio' will match all repos in dataroots, 'datarootsio/databooks' will only match a single repo)
`exclude_repos_override`: [optional] comma separated list of repos to override from exclusion list (e.g. 'datarootsio' in exclude_repos and 'datarootsio/databooks' in exclude_repos_override will ONLY include databooks in stats)
`theme`: [optional] see [themes](#themes) for options
## FAQ
- *Which repositories count towards my stargazers count?*
Check out the logs of your action run. It will log which repositories are included after the exclude and override filters have been applied.
- *How do I refresh the badge?*
You probably want to look into the `schedule` [event trigger](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule). It allows you to use a cron-based schedule that allows you to for example refresh your badge daily.