Home

Awesome

<p align="center"> <img src="https://socialify.git.ci/athul/waka-readme/image?description=1&font=Source%20Code%20Pro&forks=1&issues=1&name=1&owner=1&pulls=1&stargazers=1&theme=Auto" alt="waka-readme" width="640" height="320" /> </p>

Dev Metrics in Readme Unit Tests

WakaTime coding metrics on your profile readme.

<!-- prettier-ignore-start --> <picture> <source srcset="https://github.com/athul/waka-readme/assets/38415384/60a6bcd0-01f8-421a-8730-7e872d216e09" media="(prefers-color-scheme: dark)" /> <img src="https://github.com/athul/waka-readme/assets/38415384/29541cbc-0e39-47c4-93c2-514032b47276" alt="new_secrets_actions" /> </picture> <!-- prettier-ignore-end -->

:speech_balloon: Forum | GitHub discussions

New to WakaTime?

Nope? Skip to #Prep work.

WakaTime gives you an idea of the time you spent on coding. This helps you boost your productivity and competitive edge (aka flex :muscle:).

  1. Head over to https://wakatime.com/ and create an account.
  2. After logging in get your WakaTime API Key from https://wakatime.com/api-key/.
  3. Install WakaTime plugin in your favorite editor / IDE.
  4. Paste in your API key to start telemetry.

:information_source: Info | You can read WakaTime help to know more about configurations. Alternatively, you can fetch data from WakaTime compatible services such as Wakapi or Hakatime.

Prep Work

A GitHub repository and a README.md file is required. We'll be making use of readme in the profile repository.

Tweaks

There are many flags that you can modify as you see fit.

Meta Tweaks

Environment flagOptions (Default, Other, ...)Description
API_BASE_URLhttps://wakatime.com/api, https://wakapi.dev/api, https://hakatime.mtx-dev.xyz/apiUse WakaTime compatible services like Wakapi & Hakatime
REPOSITORY<gh_username>/<gh_username>, <gh_username>/<repo_name>Waka-readme stats will appear on the provided repository

Content Tweaks

Environment flagOptions (Default, Other, ...)Description
SHOW_TITLEfalse, trueAdd title to waka-readme stats blob
SECTION_NAMEwaka, any alphanumeric stringThe generator will look for section name to fill up the readme.
BLOCKS░▒▓█, ⣀⣄⣤⣦⣶⣷⣿, -#, =>, you can be creativeAscii art used to build stats graph
CODE_LANGtxt, python ruby json , you can use other languages alsoLanguage syntax based highlighted text
TIME_RANGElast_7_days, last_30_days, last_6_months, last_year, all_timeString representing a dispensation from which stats are aggregated
LANG_COUNT5, any plausible numberNumber of languages to be displayed
SHOW_TIMEtrue, falseDisplays the amount of time spent for each language
SHOW_TOTALfalse, trueShow total coding time
SHOW_MASKED_TIMEfalse, trueAdds total coding time including unclassified languages (overrides: SHOW_TOTAL)
STOP_AT_OTHERfalse, trueStop when language marked as Other is retrieved (overrides: LANG_COUNT)
IGNORED_LANGUAGES<code> </code>, Binary YAML JSON TOMLHide languages from your stats

Commit Tweaks

Environment flagOptions (Default, Other, ...)
COMMIT_MESSAGEUpdated waka-readme graph with new metrics, any reasonable message
TARGET_BRANCHNOT_SET, target branch name
TARGET_PATHNOT_SET, /path/to/target/file
COMMITTER_NAMENOT_SET, committer name
COMMITTER_EMAILNOT_SET, committer email
AUTHOR_NAMENOT_SET, author name
AUTHOR_EMAILNOT_SET, author email

The first option is the default value of the flag, subsequent options are valid values available for the flag.

Example

waka-readme.yml

name: Waka Readme

on:
  # for manual workflow trigger
  workflow_dispatch:
  schedule:
    # runs at 12 AM UTC (5:30 AM IST)
    - cron: "0 0 * * *"

jobs:
  update-readme:
    name: WakaReadme DevMetrics
    runs-on: ubuntu-latest
    steps:
        # this action name
      - uses: athul/waka-readme@master # do NOT replace with anything else
        with:
          GH_TOKEN: ${{ secrets.GH_TOKEN }} # optional if on profile readme
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }} # required
          ### meta
          API_BASE_URL: https://wakatime.com/api # optional
          REPOSITORY: YOUR_GITHUB_USERNAME/YOUR_REPOSITORY_NAME # optional
          ### content
          SHOW_TITLE: true # optional
          SECTION_NAME: waka # optional
          BLOCKS: -> # optional
          CODE_LANG: rust # optional
          TIME_RANGE: all_time # optional
          LANG_COUNT: 10 # optional
          SHOW_TIME: true # optional
          SHOW_TOTAL: true # optional
          SHOW_MASKED_TIME: false # optional
          STOP_AT_OTHER: true # optional
          IGNORED_LANGUAGES: YAML JSON TOML # optional
          ### commit
          COMMIT_MESSAGE: Updated waka-readme graph with new metrics # optional
          TARGET_BRANCH: master # optional
          TARGET_PATH: README.md # optional
          COMMITTER_NAME: GitHubActionBot # optional
          COMMITTER_EMAIL: action-bot@github.com # optional
          AUTHOR_NAME: YOUR_NAME # optional
          AUTHOR_EMAIL: YOUR@EMAIL.com # optional
          # you can populate email-id with secrets instead

Rendered markdown:

<!-- prettier-ignore-start -->
From: 10 July 2020 - To: 06 August 2022

Total Time: 1,464 hrs 54 mins

Python             859 hrs 29 mins >>>>>>>>>>>>>>-----------   54.68 %
Markdown           132 hrs 33 mins >>-----------------------   08.43 %
TeX                103 hrs 52 mins >>-----------------------   06.61 %
HTML               94 hrs 48 mins  >>-----------------------   06.03 %
Nim                64 hrs 31 mins  >------------------------   04.11 %
Other              47 hrs 58 mins  >------------------------   03.05 %
<!-- prettier-ignore-end -->

Notes

Why only the language stats (and not other data) from the API?

I am a fan of minimal designs and the profile readme is a great way to show off your skills and interests. The WakaTime API, gets us a lot of data about a person's coding activity including the editors and Operating Systems you used and the projects you worked on. Some of these projects maybe secretive and should not be shown out to the public. Using up more data via the Wakatime API will clutter the profile readme and hinder your chances on displaying what you provide value to the community like the pinned Repositories. I believe that Coding Stats is nerdiest of all since you can tell the community that you are exercising these languages or learning a new language, this will also show that you spend some amount of time to learn and exercise your development skills. That's what matters in the end :heart: