Skip to content

Commit 46f1b2b

Browse files
committed
feat: wakatime workflow
1 parent 908c29b commit 46f1b2b

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

.github/workflows/readme-stats.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: WakaTime on Readme
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "30 1 * * *"
6+
7+
jobs:
8+
update-readme:
9+
name: WakaReadme DevMetrics
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Update Readme with WakaTime Stats
17+
uses: athul/waka-readme@master
18+
with:
19+
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
20+
BLOCKS: ⣀⣄⣤⣦⣶⣷⣿
21+
TIME_RANGE: all_time
22+
SHOW_TIME: true
23+
SHOW_TOTAL: true
24+
SHOW_MASKED_TIME: true
25+
26+
- name: Update Workflow Stats
27+
run: |
28+
cd scripts && npm install && ACCESS_TOKEN=${{ secrets.ACCESS_TOKEN }} npm run update:workflow
29+
30+
- name: Configure Git
31+
run: |
32+
git config --local user.email "${{ secrets.GIT_EMAIL }}"
33+
git config --local user.name "${{ secrets.GIT_USERNAME }}"
34+
35+
- name: Commit and Push changes
36+
run: |
37+
git add -A
38+
git diff-index --quiet HEAD || (git commit -m "docs: update README stats [skip ci]" && git push)
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,9 @@ My name is Pulkit. I'm a undergraduate from 🇮🇳 [![wakatime](https://wakati
125125

126126
---
127127

128-
<br/>
129-
130-
131-
[<img src="https://wakatime.com/share/@pulkitxm/b09efaa2-860c-4ed4-afbe-4a645828d6fe.svg" />](https://wakatime.com/@018b392d-3ab1-4608-aec5-c9d51a551252)
132-
<br/>
128+
<h3 align="left">🔥 My Stats</h3>
129+
<!--START_SECTION:waka-->
130+
<!--END_SECTION:waka-->
133131

134132
------------
135133

scripts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"start": "node src/index.js",
99
"get:posts": "node src/fetchLatestBlogPosts.js",
1010
"get:followers": "node src/fetchFollowers.js",
11+
"update:workflow": "node src/updateWorkflow.js",
1112
"format": "prettier --write \"**/*.{js,json}\""
1213
},
1314
"keywords": [],

0 commit comments

Comments
 (0)