GitHub README
.CJwa-PoU.png)
This is a github action for those who use Wakatime to track their coding activity. You can add the stats from wakatime in your github profile's README or any other repository.
Here's an example of my coding activity over the last week
Usage
- Fetch your WakaTime API Key. Available from your WakaTime account settings.
- Add WakaTime API Key to your repository secret with the name as WAKATIME_API_KEY. How to add secrets
- Add the image tag in your README file. Also, you can use it anywhere you want to.
html
<img src="https://github.com/<username>/<repository-name>/blob/master/images/codeStats.svg" alt="Alternative Text"/>
Example: <img src="https://github.com/tariksahni/tariksahni/blob/master/codeStats.svg" alt="My Coding Activity/>
```sql
4. Click **Action** tab on the repo you want to add this and **choose set up a workflow yourself** option.
5. Copy the following code.
```sql
name: Update README with my latest coding stats
on:
schedule:
- cron: '30 5 * * *'
jobs:
update-Readme:
name: Automatically update my README
runs-on: ubuntu-latest
steps:
- uses: tariksahni/coding-stats-wakatime@v1.0.0
with:
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
SHOW_MONTHLY: true
GITHUB_TOKEN: ${{ github.token }}
GITHUB_ACTION: ${{ github.action }}Note: You can choose the duration of your activity from monthly(default) to weekly. For weekly set `SHOW_MONTHLY: false`.
The workflow will run at 10 AM IST every day or you can force run it by going to Action tab. Or you can add following lines under
on:to run with every push. Search for 12 AM UTC to find equivalent time in your time zone.on: push: branches: [ master ] schedule: - cron: '30 5 * * *'