Skip to content

Commit 658ff45

Browse files
committed
feat: wakatime workflow
1 parent 908c29b commit 658ff45

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

.github/workflows/readme-stats.yml

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

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)