Update Wakatime Stats #419
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Wakatime Stats | |
on: | |
schedule: | |
- cron: '*/30 * * * *' # Runs every 30 minutes | |
push: | |
branches: | |
- main | |
jobs: | |
update-wakatime: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Fetch Wakatime Stats | |
run: | | |
curl -H "Authorization: Bearer ${{ secrets.WAKATIME_API_KEY }}" -o wakatime-stats.json https://wakatime.com/api/v1/users/current/stats/last_7_days | |
- name: Commit and Push changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add wakatime-stats.json | |
git commit -m "Update Wakatime stats" | |
git push |