Automatically update your GitHub profile README with beautiful metrics about your coding activity! This GitHub Action collects data from your repositories and WakaTime, then displays stunning statistics directly on your profile.
- π Commit Patterns - Visualize when you code most (time of day, day of week)
- π» Language Statistics - Track programming languages across your repositories
- β±οΈ WakaTime Integration - Display coding time, editors, projects and OS usage
- π¨ Customizable - Choose metrics and customize appearance
- π Auto-Updating - Runs on schedule to keep your profile fresh
- π Easy Setup - Get started in 5 minutes
Create a repository with the same name as your GitHub username (e.g., username/username). This special repository's README will appear on your GitHub profile.
π‘ Tip: Don't have a profile repository yet? Learn more about GitHub profile READMEs
Add these comments to your README.md where you want the metrics to appear:
<!--START_SECTION:readme-stats-->
<!--END_SECTION:readme-stats-->π‘ Tip: You can customize the section name using the
SECTION_NAMEvariable
-
GitHub Token (Required)
- Go to GitHub Settings β Developer settings β Personal access tokens β Tokens (classic)
- Click "Generate new token (classic)"
- Select scopes:
repoanduser - Generate and copy the token
π Security Note: The
reposcope is only used to read commit metadata (timestamps and line changes). Your code is never accessed or stored -
WakaTime API Key (Optional)
- Optional, only needed if you want to display coding time statistics
- Get your key from WakaTime Settings
- Go to your profile repository's Settings β Secrets and variables β Actions
- Click New repository secret
- Add these secrets:
- Name:
GH_TOKEN, Value: Your GitHub token - Name:
WAKATIME_API_KEY, Value: Your WakaTime key (if using WakaTime)
- Name:
Create .github/workflows/update-stats.yml in your profile repository:
name: Update README Stats
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Allows manual trigger
jobs:
update-readme:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Stats
uses: thanhhaudev/github-stats@master
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
SHOW_METRICS: "COMMIT_TIMES_OF_DAY,COMMIT_DAYS_OF_WEEK,LANGUAGE_PER_REPO"- Go to the Actions tab in your repository
- Click on Update README Stats workflow
- Click Run workflow β Run workflow
- Wait a few seconds and check your README
Choose which metrics to display by setting the SHOW_METRICS environment variable with a comma-separated list.
Example:
SHOW_METRICS: "COMMIT_TIMES_OF_DAY,COMMIT_DAYS_OF_WEEK,LANGUAGE_PER_REPO"Shows when you code during the day (morning, daytime, evening, night).
Example output:
π I'm An Early Bird π€
π
Morning 214 commits βββββββββββββββββββββββββ 17.33%
π Daytime 444 commits βββββββββββββββββββββββββ 35.95%
π Evening 351 commits βββββββββββββββββββββββββ 28.42%
π Night 226 commits βββββββββββββββββββββββββ 18.30%
π‘ Tip: Set
SIMPLIFY_COMMIT_TIMES_TITLE: "true"to show just "I'm An Early π€" or "I'm A Night π¦"
Shows which days of the week you're most productive.
Example output:
π I'm Most Productive on Sundays
Sunday 112 commits βββββββββββββββββββββββββ 24.03%
Monday 57 commits βββββββββββββββββββββββββ 12.23%
Tuesday 58 commits βββββββββββββββββββββββββ 12.45%
Wednesday 73 commits βββββββββββββββββββββββββ 15.67%
Thursday 94 commits βββββββββββββββββββββββββ 20.17%
Friday 31 commits βββββββββββββββββββββββββ 06.65%
Saturday 41 commits βββββββββββββββββββββββββ 08.80%
Shows the primary programming language distribution across your repositories.
Example output:
π₯ I Mostly Code in Go
Go 6 repos βββββββββββββββββββββββββ 85.71%
TypeScript 1 repo βββββββββββββββββββββββββ 14.29%
Displays all languages you use with colorful badges showing percentages.
Example output:
π¬ Languages & Tools
Shows detailed coding activity from WakaTime (requires WakaTime API key).
Requirements:
- Set
WAKATIME_API_KEYwith your WakaTime API key - Set
WAKATIME_DATAto choose what to display (comma-separated)
Available data types:
EDITORS- Which code editors you useLANGUAGES- Programming languages you code inPROJECTS- Projects you work onOPERATING_SYSTEMS- Operating systems you use
Example configuration:
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
WAKATIME_DATA: "EDITORS,LANGUAGES,PROJECTS,OPERATING_SYSTEMS"
WAKATIME_RANGE: "last_7_days"Example output:
π Editors:
PhpStorm 42 hrs 14 mins βββββββββββββββββββββββββ 93.02%
GoLand 3 hrs 10 mins βββββββββββββββββββββββββ 06.98%
π¬ Languages:
Go 22 hrs 19 mins βββββββββββββββββββββββββ 49.16%
JavaScript 14 hrs 41 mins βββββββββββββββββββββββββ 32.34%
Python 1 hr 53 mins βββββββββββββββββββββββββ 04.18%
π¦ Projects:
Project A 6 hrs 47 mins βββββββββββββββββββββββββ 77.43%
Project B 1 hr 35 mins βββββββββββββββββββββββββ 18.07%
Project C 23 mins βββββββββββββββββββββββββ 04.49%
π» Operating Systems:
Windows 42 hrs 14 mins βββββββββββββββββββββββββ 70.00%
Mac 12 hrs 10 mins βββββββββββββββββββββββββ 20.00%
Linux 6 hrs 3 mins βββββββββββββββββββββββββ 10.00%
Time range options (set with WAKATIME_RANGE):
| Value | Title Displayed |
|---|---|
last_7_days |
What I Focused On in the Last 7 Days |
last_30_days |
How I Spent My Time Over the Last 30 Days |
last_6_months |
Where My Time Went in the Last 6 Months |
last_year |
My Time Highlights from Last Year |
all_time |
How I've Used My Time Across All Time |
| Variable | Description | Required | Default |
|---|---|---|---|
GITHUB_TOKEN |
GitHub token for API access | β Yes | - |
SHOW_METRICS |
Comma-separated list of metrics to display | β Yes | - |
WAKATIME_API_KEY |
WakaTime API key for coding stats | β No | - |
WAKATIME_DATA |
WakaTime data to show: EDITORS, LANGUAGES, PROJECTS, OPERATING_SYSTEMS (comma-separated) |
Only if using WakaTime | - |
WAKATIME_RANGE |
Time range: last_7_days, last_30_days, last_6_months, last_year, all_time |
β No | last_7_days |
SHOW_LAST_UPDATE |
Show last update timestamp in README | β No | false |
TIME_ZONE |
Timezone for statistics (e.g., America/New_York, Asia/Tokyo) |
β No | UTC |
TIME_LAYOUT |
Go time format layout for timestamps | β No | 2006-01-02 15:04:05 -0700 |
ONLY_MAIN_BRANCH |
Only count commits from main branch (faster performance) | β No | false |
EXCLUDE_FORK_REPOS |
Exclude forked repositories from metrics | β No | false |
SECTION_NAME |
Custom section name for README markers | β No | readme-stats |
COMMIT_MESSAGE |
Custom commit message when updating README | β No | π Update README.md |
COMMIT_USER_NAME |
Git commit author name | β No | GitHub Action |
COMMIT_USER_EMAIL |
Git commit author email | β No | action@github.com |
PROGRESS_BAR_VERSION |
Progress bar style: 1 (blocks) or 2 (emoji squares) |
β No | 1 |
SIMPLIFY_COMMIT_TIMES_TITLE |
Show simplified title: "I'm An Early π€" or "I'm A Night π¦" | β No | false |
HIDE_REPO_INFO |
Hide repository information in action logs | β No | false |
You can customize the appearance of progress bars using PROGRESS_BAR_VERSION:
Version 1 (Default) - Block style:
βββββββββββββββββββββββββ
Version 2 - Emoji squares with half-block support:
π©π©π©π©π©π©π©π©π¨β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬
Minimal Setup (GitHub stats only):
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
SHOW_METRICS: "COMMIT_TIMES_OF_DAY,COMMIT_DAYS_OF_WEEK,LANGUAGE_PER_REPO"Full Setup (with WakaTime):
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
WAKATIME_DATA: "EDITORS,LANGUAGES,PROJECTS,OPERATING_SYSTEMS"
WAKATIME_RANGE: "last_30_days"
SHOW_METRICS: "COMMIT_TIMES_OF_DAY,COMMIT_DAYS_OF_WEEK,LANGUAGE_PER_REPO,LANGUAGES_AND_TOOLS,WAKATIME_SPENT_TIME"
SHOW_LAST_UPDATE: "true"
ONLY_MAIN_BRANCH: "true"
PROGRESS_BAR_VERSION: "2"Performance Optimized:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
SHOW_METRICS: "COMMIT_TIMES_OF_DAY,LANGUAGE_PER_REPO"
ONLY_MAIN_BRANCH: "true" # Faster - only scans main branch
EXCLUDE_FORK_REPOS: "true" # Skip forked repositories
HIDE_REPO_INFO: "true" # Cleaner logsCan I use this on a regular repository (not my profile)?
Yes! You can use this action on any repository. Just add the markers to any markdown file and configure the workflow accordingly.
How often does it update?
By default, the workflow runs daily at midnight UTC (configured with cron: '0 0 * * *'). You can change this schedule or trigger it manually anytime.
Does this count private repository commits?
Yes, if your GitHub token has access to private repositories (which it does with the repo scope), it will count commits from private repos too.
Can I customize the appearance?
Yes! You can:
- Choose which metrics to display with
SHOW_METRICS - Change progress bar style with
PROGRESS_BAR_VERSION - Simplify titles with
SIMPLIFY_COMMIT_TIMES_TITLE - Set custom timezone with
TIME_ZONE
Is my data safe?
Absolutely! This action:
- Only reads commit metadata (timestamps, line counts)
- Never accesses your actual code
- Runs in your own GitHub Actions environment
- Doesn't send data to any external services (except WakaTime API if you enable it)