You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i️ 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.
Save the README.md file after copy-pasting the following special comments. Your dev-metics will show up in between.
<!--START_SECTION:waka--><!--END_SECTION:waka-->
<!--START_SECTION: --> and <!--END_SECTION: --> are placeholders and must be retained as is. Whereas "waka" can be replaced by any alphanumeric string. See #Tweaks section for more.
Navigate to your repo's Settings:
Go to Secrets (at https://github.com/USERNAME/USERNAME/settings/secrets/actions/new by replacing the USERNAME with your own username) and add a new secret "Named" WAKATIME_API_KEY with your API key as it's "Secret".
new_secrets_actions
If you're not using profile repository, add another secret "Named" GH_TOKEN and in place of "Secret" insert your GitHub token.
Go to Workflow permissions under Actions (at https://github.com/USERNAME/USERNAME/settings/actions by replacing the USERNAME with your own username) and set Read and write permissions.
new_secrets_actions
Create a new workflow file named waka-readme.yml inside .github/workflows/ folder of your repository.
Clear all existing contents, add following lines and save the file.
name: Waka Readmeon:
# for manual workflow triggerworkflow_dispatch:
schedule:
# runs at 12 AM UTC (5:30 AM IST)
- cron: "0 0 * * *"jobs:
update-readme:
name: WakaReadme DevMetricsruns-on: ubuntu-lateststeps:
- uses: athul/waka-readme@master # this action namewith:
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
Refer #Example section for a full blown workflow file.
Tweaks
There are many flags that you can modify as you see fit.
String representing a dispensation from which stats are aggregated
LANG_COUNT
5, any plausible number
Number of languages to be displayed
SHOW_TIME
true, false
Displays the amount of time spent for each language
SHOW_TOTAL
false, true
Show total coding time
SHOW_MASKED_TIME
false, true
Adds total coding time including unclassified languages (overrides: SHOW_TOTAL)
STOP_AT_OTHER
false, true
Stop when language marked as Other is retrieved (overrides: LANG_COUNT)
IGNORED_LANGUAGES
, Binary YAML JSON TOML
Hide languages from your stats
Commit Tweaks
Environment flag
Options (Default, Other, ...)
COMMIT_MESSAGE
Updated waka-readme graph with new metrics, any reasonable message
TARGET_BRANCH
NOT_SET, target branch name
TARGET_PATH
NOT_SET, /path/to/target/file
COMMITTER_NAME
NOT_SET, committer name
COMMITTER_EMAIL
NOT_SET, committer email
AUTHOR_NAME
NOT_SET, author name
AUTHOR_EMAIL
NOT_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 Readmeon:
# for manual workflow triggerworkflow_dispatch:
schedule:
# runs at 12 AM UTC (5:30 AM IST)
- cron: "0 0 * * *"jobs:
update-readme:
name: WakaReadme DevMetricsruns-on: ubuntu-lateststeps:
# this action name
- uses: athul/waka-readme@master # do NOT replace with anything elsewith:
GH_TOKEN: ${{ secrets.GH_TOKEN }} # optional if on profile readmeWAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }} # required### metaAPI_BASE_URL: https://wakatime.com/api # optionalREPOSITORY: YOUR_GITHUB_USERNAME/YOUR_REPOSITORY_NAME # optional### contentSHOW_TITLE: true # optionalSECTION_NAME: waka # optionalBLOCKS: -> # optionalCODE_LANG: rust # optionalTIME_RANGE: all_time # optionalLANG_COUNT: 10# optionalSHOW_TIME: true # optionalSHOW_TOTAL: true # optionalSHOW_MASKED_TIME: false # optionalSTOP_AT_OTHER: true # optionalIGNORED_LANGUAGES: YAML JSON TOML # optional### commitCOMMIT_MESSAGE: Updated waka-readme graph with new metrics # optionalTARGET_BRANCH: master # optionalTARGET_PATH: README.md # optionalCOMMITTER_NAME: GitHubActionBot # optionalCOMMITTER_EMAIL: action-bot@github.com # optionalAUTHOR_NAME: YOUR_NAME # optionalAUTHOR_EMAIL: YOUR@EMAIL.com # optional# you can populate email-id with secrets instead
Rendered markdown:
From:10July2020 - To:06August2022TotalTime:1,464 hrs 54 mins
Python859 hrs 29 mins >>>>>>>>>>>>>>----------- 54.68 %
Markdown132 hrs 33 mins >>----------------------- 08.43 %
TeX103 hrs 52 mins >>----------------------- 06.61 %
HTML94 hrs 48 mins >>----------------------- 06.03 %
Nim64 hrs 31 mins >------------------------ 04.11 %
Other47 hrs 58 mins >------------------------ 03.05 %
Notes
Flags REPOSITORY and GH_TOKEN are required ONLY if, you are NOT using profile readme.
If you are using GH_TOKEN, make sure set the fine grained token scope to repository contents with read-and-write access. See #141 (comment).
WAKATIME_API_KEY is a required secret. All other environment variables are optional.
The above example does NOT show proper default values, refer #Tweaks for the same.
IGNORED_LANGUAGES is suggested for .NET users, as WakaTime assumes you're working with Binary, while debugging.
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 ❤️