Skip to content

GitHub README.md Metrics

Actions

About

Update your GitHub README.md with cool metrics
v1.6.0
Latest
Star (20)

Quick start

  1. Use a profile repo: a repo named exactly <your-username>/<your-username>. Its README shows on your profile page.
  2. Add markers in that README where stats should land:
    <!--START_SECTION:readme-stats-->
    <!--END_SECTION:readme-stats-->
  3. Add secrets at Settings → Secrets and variables → Actions:
    • GH_TOKEN — Personal access token (classic), scope repo. (create one)
    • WAKATIME_API_KEY — optional, only for WakaTime metrics. (get key)
  4. Add .github/workflows/update-stats.yml:
    name: Update README Stats
    on:
      schedule:
        - cron: '0 0 * * *'    # daily at midnight UTC
      workflow_dispatch:
    jobs:
      update:
        runs-on: ubuntu-latest
        permissions:
          contents: write
        steps:
          - uses: actions/checkout@v4
          - uses: thanhhaudev/github-stats@v1
            env:
              GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
              WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
              SHOW_METRICS: "CODING_STREAK"

    ⚠️ For long-term use, fork this repository and run your forked Action, or pin to a specific release/SHA instead of relying on thanhhaudev/github-stats@v1. This avoids unexpected behavior changes when the upstream v1 tag moves.

  5. Trigger once: Actions → Update README Stats → Run workflow.

Sample output

📈 Coding Streak

🔥 Current Streak:        14 days
🏆 Longest Streak:        45 days
📊 Daily Average:         3 hrs 44 mins
💪 Total Coding Time:     1,383 hrs 16 mins
🎯 Coding Consistency:    87.5%
📅 Active Days:           128 days

Every other metric: docs/metrics.md.

Metrics

Set SHOW_METRICS to a comma-separated list. Output appears in the order you list.

Key Shows
CODING_STREAK Streak + (with WakaTime) daily-average totals
COMMIT_TIMES_OF_DAY Morning / Daytime / Evening / Night split
COMMIT_DAYS_OF_WEEK Commits per weekday
LANGUAGE_PER_REPO Primary language per repo
LANGUAGES_AND_TOOLS Per-language badges
WAKATIME_AI_STATS AI vs human attribution (needs WakaTime + GenAI integration)
WAKATIME_SPENT_TIME Editors / Languages / Projects / OS time

Required env vars

Variable Purpose
GITHUB_TOKEN API access. Scope repo.
SHOW_METRICS Which metrics to render.
WAKATIME_API_KEY Required for any WAKATIME_* metric and for time fields in CODING_STREAK.
WAKATIME_DATA Required if WAKATIME_SPENT_TIME is in SHOW_METRICS. Any of EDITORS, LANGUAGES, PROJECTS, OPERATING_SYSTEMS.

Full env var list (timezone, cache, commit author, progress-bar style, emoji stripping, etc.): docs/configuration.md.

More docs

Notes

  • Reads commit metadata only (timestamps, line counts). Never reads file contents.
  • Counts private-repo commits when the token has repo scope.
  • Works on any repo, not just your profile repo. Override the marker name with SECTION_NAME.

GitHub README.md Metrics is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Update your GitHub README.md with cool metrics
v1.6.0
Latest

GitHub README.md Metrics is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.