cft

Showing off your Dev Metrics on your Github Readme profile using WakaTime

Make your Github Profile Readme look awesome by showing your coding stats using Wakatime API.


user

Ankur Patil

2 years ago | 2 min read

Your profile page tells people the story of your work through the repositories you're interested in, the contributions you've made, and the conversations you've had. So, you should put an effort into making your profile stand out.

Waka TIme Stats

One way to do this is to show your visitors nerdy stats like how much coding you've been doing, what languages you have been working on and how productive you've been for the past few days. You can take a look at the screenshot of my Github profile, amazing isn't it.

Prerequisites:

  • A Github account
  • A Github profile README (don't have one, follow docs to create one)
  • A WakaTime account (set it up here )

Steps:

  • To start with, edit your README.md of your Github profile, your repo will be username/username and insert:

<!--START_SECTION:waka-->

<!--END_SECTION:waka-->

wherever you want your code stats to appear.

  • Next step is to get your WakaTime API Key from your "Account Settings" in WakaTime, as shown below:
  • Wakatime API Key
  • Next, you'll need to install the WakaTime plugin for your favourite IDE. Look into this page to get information about various plugins for different IDEs. In my case, I prefer VS Code so I installed its VS Code plugin. To set up WakaTime with VS Code visit: https://wakatime.com/vs-code
  • Now, head back to your Github repo, go to the "Settings" tab and then "Secrets". Create a new Actions Secret (not an environment one). The name of this secret must be WAKATIME_API_KEY and the value should be the API key obtained in the previous step.
  • Github Repository Secret
  • Next, create a GitHub workflow with name and directory as specified:.github/workflows/waka.yml. And paste the following code in the newly created workflow:

name: Waka Readme

on:

schedule:

# Runs every 4 hours

- cron: '0 */4 * * *'

workflow_dispatch:

jobs:

update-readme:

name: Update Readme with Metrics

runs-on: ubuntu-latest

steps:

- uses: anmol098/waka-readme-stats@master

with:

WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}

SHOW_OS: "True"

SHOW_PROJECTS: "True"

SHOW_PROFILE_VIEWS: "False"

SHOW_EDITORS: "False"

SHOW_LANGUAGE_PER_REPO: "True"

SHOW_LOC_CHART: "False"

SHOW_LINES_OF_CODE: "True"

SHOW_SHORT_INFO: "False"

The job runs every 4 hours, in order to make some adjustments, visit: https://crontab.guru.

Note: It takes time for your stats to appear, you need to log enough time in WakaTime, and give it enough data to actually report.

Conclusion:

Thank you for reading, hope you enjoyed the article! Queries and feedback are most welcome :) kindly leave them below.

Follow me on Twitter | LinkedIn for more web development-related tips and posts.

That's all for today! You have read the article till the end.

Upvote


user
Created by

Ankur Patil

A Full Stack Developer, Technical Writer, Tech Enthusiast and an Open Source contributor. I ❤️ making GitHub Actions and Full Stack WebApps. DevOps always blows my mind 🤯


people
Post

Upvote

Downvote

Comment

Bookmark

Share


Related Articles