{"id":18997419,"url":"https://github.com/thanhhaudev/github-stats","last_synced_at":"2025-04-22T14:07:24.073Z","repository":{"id":253743094,"uuid":"839694790","full_name":"thanhhaudev/github-stats","owner":"thanhhaudev","description":"Show impressive metrics on your GitHub profile 😎 📊","archived":false,"fork":false,"pushed_at":"2025-03-06T05:30:40.000Z","size":117,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T14:07:15.683Z","etag":null,"topics":["awsome-profile","github-api","github-profile-readme","markdown","metrics","profile-generator","profile-readme","readme","time-tracker","wakatime","wakatime-api","wakatime-plugin","wakatime-stats"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thanhhaudev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-08T06:27:32.000Z","updated_at":"2025-03-31T06:21:55.000Z","dependencies_parsed_at":"2024-08-26T11:00:57.724Z","dependency_job_id":"0c3060f7-0ddd-4695-ac4b-2dbb1dbe2fbc","html_url":"https://github.com/thanhhaudev/github-stats","commit_stats":null,"previous_names":["thanhhaudev/github-stats"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanhhaudev%2Fgithub-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanhhaudev%2Fgithub-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanhhaudev%2Fgithub-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanhhaudev%2Fgithub-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thanhhaudev","download_url":"https://codeload.github.com/thanhhaudev/github-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250255710,"owners_count":21400410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awsome-profile","github-api","github-profile-readme","markdown","metrics","profile-generator","profile-readme","readme","time-tracker","wakatime","wakatime-api","wakatime-plugin","wakatime-stats"],"created_at":"2024-11-08T17:40:29.120Z","updated_at":"2025-04-22T14:07:24.042Z","avatar_url":"https://github.com/thanhhaudev.png","language":"Go","readme":"# GitHub README.md Metrics 📊\n\nThis GitHub Action collects your GitHub data and coding activity from WakaTime. It updates a part of your README.md file with cool metrics from this data and then commits and pushes the changes to your repository.\n\n## Prerequisites\n\n1. **Special Repository**: To make this Action work, you need a **special repository** with the same name as your GitHub username (e.g., `username/username`). This is a special repository on GitHub where the README will show up on your profile.\n\n\n2. **Update the Markdown File**: You need to add two special comments to your Markdown (.md) file. These comments will be used to update the file with the metrics. You can add these comments anywhere in the file, but it's recommended to add them at the end of the file.\n\n   ```markdown\n   \u003c!--START_SECTION:readme-stats--\u003e\n   \u003c!--END_SECTION:readme-stats--\u003e\n   ```\n\n   The Action will replace everything between these two comments with the metrics. You can also specify a section name in the `SECTION_NAME` environment variable.\n\n\n3. **GitHub Access Token**: To get commit information, you need a GitHub Access Token with `repo` and `user` permissions, available [here](https://github.com/settings/tokens). \n   \u003eAlthough giving `repo` access might seem **risky**, this Action only accesses commit timestamps and lines of code added or deleted in the repositories you contributed to, which is completely safe.\n\n4. **WakaTime API Key (Optional)**: If you want to use the `WAKATIME_SPENT_TIME` metric, you will need a WakaTime API Key. You can get this from your [WakaTime Account Settings](https://wakatime.com/settings/api-key).\n\n\n5. **Store Access Keys in Secrets**: You need to store the WakaTime API Key and GitHub Access Token in your repository secrets. You can find this option in the **Settings** of your GitHub repository. Make sure to save them under the following names:\n\n   + **WAKATIME_API_KEY**: Your WakaTime API Key.\n   + **GH_TOKEN**: Your GitHub Access Token.\n\n\u003cimg width=\"1128\" alt=\"image\" src=\"https://github.com/user-attachments/assets/40d8c7aa-2c44-40d5-820c-9e93e8637554\"\u003e\n\n\n## Usage\n\n### Environment Variables\n| Name                          | Description                                                                                                                                                                                      | Required                          | Default                   |\n|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|---------------------------|\n| `GITHUB_TOKEN`                | The GitHub token to authenticate API requests.                                                                                                                                                   | Yes                               | -                         |\n| `SHOW_METRICS`                | The metrics to show in the `README.md` file.                                                                                                                                                     | Yes                               | -                         |\n| `WAKATIME_API_KEY`            | The WakaTime API key to fetch coding activity statistics.                                                                                                                                        | No                                | -                         |\n| `WAKATIME_RANGE`              | The range for WakaTime statistics (e.g., `last_7_days`, `last_30_days`, `last_6_months`, `last_year`, `all_time`).                                                                               | No                                | last_7_days               |\n| `WAKATIME_DATA`               | The data to show from WakaTime statistics.                                                                                                                                                       | If `WAKATIME_API_KEY` is provided | -                         |\n| `TIME_ZONE`                   | The timezone to use for statistics.                                                                                                                                                              | No                                | UTC                       |\n| `TIME_LAYOUT`                 | The layout of the time to show in the last update time.                                                                                                                                          | No                                | 2006-01-02 15:04:05 -0700 |\n| `SHOW_LAST_UPDATE`            | Whether to show the last update time in the `README.md` file.                                                                                                                                    | No                                | -                         |\n| `ONLY_MAIN_BRANCH`            | Whether to fetch data only from the main branch. If you don’t set this, it will search for commits in all branches of the repository to count the number of commits, which might take more time. | No                                | -                         |\n| `COMMIT_MESSAGE`              | The commit message to use when updating the `README.md`.                                                                                                                                         | No                                | 📝 Update README.md       |\n| `COMMIT_USER_NAME`            | The name to use for the commit.                                                                                                                                                                  | No                                | GitHub Action             |\n| `COMMIT_USER_EMAIL`           | The email to use for the commit.                                                                                                                                                                 | No                                | action@github.com         |\n| `SECTION_NAME`                | The section name in the `README.md` to update.                                                                                                                                                   | No                                | readme-stats              |\n| `HIDE_REPO_INFO`              | Whether to hide the repository information in action logs.                                                                                                                                       | No                                | -                         |\n| `PROGRESS_BAR_VERSION`        | The version of the progress bar to use.                                                                                                                                                          | No                                | 1                         |\n| `EXCLUDE_FORK_REPOS`          | Whether to exclude fork repositories from the metrics.                                                                                                                                           | No                                | -                         |\n| `LANGUAGES_AND_TOOLS`         | The languages and tools that you used in your repositories.                                                                                                                                      | No                                | -                         |\n| `SIMPLIFY_COMMIT_TIMES_TITLE` | If you want to display a simplified title when using `COMMIT_TIMES_OF_DAY`, enable this option to show either \"I'm An Early 🐤\" or \"I'm A Night 🦉\" based on the commit time.                    | No                                | -                         |\n\n### Metrics\nThe `SHOW_METRICS` environment variable is used to specify the metrics to show in the `README.md` file. You can choose from the following metrics:\n\n**COMMIT_TIMES_OF_DAY**: The distribution of your commits across different times of the day, such as morning, daytime, evening, and night.\n\n   **🕒 I'm An Afternoon Warrior 🥷🏻**\n   ```\n    🌅 Morning                136 commits         ███████░░░░░░░░░░░░░░░░░░   29.18%\n    🌞 Daytime                265 commits         ██████████████░░░░░░░░░░░   56.87%\n    🌆 Evening                1 commit            ░░░░░░░░░░░░░░░░░░░░░░░░░   00.21%\n    🌙 Night                  64 commits          ███░░░░░░░░░░░░░░░░░░░░░░   13.73%\n   ```\n\n**COMMIT_DAYS_OF_WEEK**: The days of the week you make commits.\n\n   **📅 I'm Most Productive on Sundays**\n   ```\n    Sunday                   112 commits         ██████░░░░░░░░░░░░░░░░░░░   24.03%\n    Monday                   57 commits          ███░░░░░░░░░░░░░░░░░░░░░░   12.23%\n    Tuesday                  58 commits          ███░░░░░░░░░░░░░░░░░░░░░░   12.45%\n    Wednesday                73 commits          ████░░░░░░░░░░░░░░░░░░░░░   15.67%\n    Thursday                 94 commits          █████░░░░░░░░░░░░░░░░░░░░   20.17%\n    Friday                   31 commits          ██░░░░░░░░░░░░░░░░░░░░░░░   06.65%\n    Saturday                 41 commits          ██░░░░░░░░░░░░░░░░░░░░░░░   08.80%\n   ```\n\n**LANGUAGE_PER_REPO**: The languages you use in each repository.\n\n   **🔥 I Mostly Code in Go**\n   ```\n   Go                       6 repos             █████████████████████░░░░   85.71%\n   TypeScript               1 repo              ████░░░░░░░░░░░░░░░░░░░░░   14.29%\n   ```\n\n**LANGUAGES_AND_TOOLS**: The languages and tools you used on your projects.\n\n   **💬 Languages \u0026 Tools** \n\n![JavaScript](https://img.shields.io/badge/JavaScript-20.0%25-f1e05a?\u0026logo=JavaScript\u0026labelColor=151b23)\n![Python](https://img.shields.io/badge/Python-13.0%25-3572A5?\u0026logo=Python\u0026labelColor=151b23)\n![Java](https://img.shields.io/badge/Java-12.0%25-b07219?\u0026logo=Java\u0026labelColor=151b23)\n![C#](https://img.shields.io/badge/C%23-9.4%25-178600?\u0026logo=CSharp\u0026labelColor=151b23)\n![PHP](https://img.shields.io/badge/PHP-7.8%25-4F5D95?\u0026logo=PHP\u0026labelColor=151b23)\n![C++](https://img.shields.io/badge/C++-7.0%25-00599C?\u0026logo=Cplusplus\u0026labelColor=151b23)\n![TypeScript](https://img.shields.io/badge/TypeScript-6.3%25-3178C6?\u0026logo=TypeScript\u0026labelColor=151b23)\n![Ruby](https://img.shields.io/badge/Ruby-3.1%25-701516?\u0026logo=Ruby\u0026labelColor=151b23)\n![Swift](https://img.shields.io/badge/Swift-2.6%25-FA7343?\u0026logo=Swift\u0026labelColor=151b23)\n![Go](https://img.shields.io/badge/Go-2.8%25-00ADD8?\u0026logo=Go\u0026labelColor=151b23)\n\n**WAKATIME_SPENT_TIME**: The time you spent coding on WakaTime. \n\nUse the `WAKATIME_DATA` environment variable to specify the data to show.\n+ **EDITORS**: The editors you use.\n   ```\n   📝 Editors:\n   PhpStorm                 42 hrs 14 mins      ███████████████████████░░   93.02%\n   GoLand                   3 hrs 10 mins       ██░░░░░░░░░░░░░░░░░░░░░░░   06.98%\n   ```\n+ **LANGUAGES**: The languages you code in.\n   ```\n  💬 Languages:\n   Go                       22 hrs 19 mins      ████████████░░░░░░░░░░░░░   49.16%\n   JavaScript               14 hrs 41 mins      ████████░░░░░░░░░░░░░░░░░   32.34%\n   Python                   1 hr 53 mins        █░░░░░░░░░░░░░░░░░░░░░░░░   04.18%\n   Java                     1 hr 27 mins        █░░░░░░░░░░░░░░░░░░░░░░░░   03.20%\n   C++                      1 hr 15 mins        █░░░░░░░░░░░░░░░░░░░░░░░░   02.78%\n   Ruby                     1 hr 12 mins        █░░░░░░░░░░░░░░░░░░░░░░░░   02.66%\n   PHP                      52 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   01.92%\n   TypeScript               43 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   01.58%\n   Swift                    22 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   00.81%\n   Rust                     15 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   00.56%\n   Others                   16 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   00.80%\n   ```\n+ **PROJECTS**: The projects you work on.\n   ```\n  📦 Projects:\n   Project A                6 hrs 47 mins       ███████████████████░░░░░░   77.43%\n   Project B                1 hr 35 mins        ████░░░░░░░░░░░░░░░░░░░░░   18.07%\n   Project C                23 mins             █░░░░░░░░░░░░░░░░░░░░░░░░   4.49%\n  ```\n+ **OPERATING_SYSTEMS**: The operating systems you use.\n  ```\n  💻 Operating Systems:\n  Windows                  42 hrs 14 mins      ████████████████████░░░░░   70.00%\n  Mac                      12 hrs 10 mins      ███████░░░░░░░░░░░░░░░░░░   20.00%\n  Linux                    6 hrs  3 mins       ████░░░░░░░░░░░░░░░░░░░░░   10.00%\n  ```\n\nYou can use the `WAKATIME_RANGE` environment variable to set the time range for WakaTime statistics. Each value will show a specific label as follows:\n+ `last_7_days`: What I Focused On in the Last 7 Days\n+ `last_30_days`: How I Spent My Time Over the Last 30 Days\n+ `last_6_months`: Where My Time Went in the Last 6 Months\n+ `last_year`: My Time Highlights from Last Year\n+ `all_time`: How I’ve Used My Time Across All Time\n\n**Note**: If you don't provide the `WAKATIME_API_KEY`, the `WAKATIME_SPENT_TIME` metric will not be shown.\n\n### Progress Bar Versions\nYou can use the `PROGRESS_BAR_VERSION` environment variable to specify the version of the progress bar to use. The available versions are:\n+ `1`: **Default Progress Bar**: Uses the default progress bar style.\n```\n████░░░░░░░░░░░░░░░░░░░░░\n```\n+ `2` **Square Symbol Progress Bar**: Uses the square symbol for the progress bar. This version also shows the half block (the remaining percentage is not enough to fill a whole block) for the progress bar.\n```\n🟩🟩🟩🟩🟩🟩🟩🟩🟨⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜\n```\n\n### Example Workflow\n\n```yaml\nname: Update README.md\n\non:\n  schedule:\n    - cron: '0 0 * * *' # Runs every day at midnight\n  workflow_dispatch:\njobs:\n  update-readme:\n    name: Update README.md\n    runs-on: ubuntu-latest\n    permissions:\n      contents: write\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - name: Run GitHub Stats Action\n        uses: thanhhaudev/github-stats@master\n        env:\n          BRANCH_NAME: ${{ github.ref_name }}\n          GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # GitHub token, required\n          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}\n          WAKATIME_DATA: \"EDITORS,LANGUAGES,PROJECTS,OPERATING_SYSTEMS\" # show data, separated by comma\n          SHOW_METRICS: \"COMMIT_TIMES_OF_DAY,LANGUAGE_PER_REPO,COMMIT_DAYS_OF_WEEK,WAKATIME_SPENT_TIME\" # show metrics, separated by comma\n          SHOW_LAST_UPDATE: \"true\" # show last update time\n          ONLY_MAIN_BRANCH: \"true\" # only fetch data from the main branch\n```\n\n---\n\u003e This project is inspired by [waka-readme-stats](https://github.com/anmol098/waka-readme-stats), which is a similar project that uses GitHub Actions to update your README with awesome metrics.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthanhhaudev%2Fgithub-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthanhhaudev%2Fgithub-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthanhhaudev%2Fgithub-stats/lists"}