github-stats-box
⚡️📌 Update a pinned gist to contain your GitHub stats
Setup
Prep work
- Create a new public GitHub Gist (the gist description will be displayed on top of your pinned Gist)
- Create a token with the
gist
scope and copy it
Project setup
-
Fork this repository
-
From your new fork, go to Settings > Secrets
-
Add the following secrets using the New secret button:
- GH_TOKEN: The GitHub token generated above.
- GIST_ID: The ID portion from your gist url:
https://gist.github.com/bokub/
387aeb084c3433e24a11b36660ba9937
. - ALL_COMMITS: Boolean value, If
true
it will count all commits instead of last year commits
-
Go to the Actions tab of your fork
-
Click set up a workflow yourself
-
Copy-paste this workflow:
name: Update Github Stats Gist
on:
schedule:
- cron: '0 * * * *'
push:
branches: master
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npx github-stats-box
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIST_ID: ${{ secrets.GIST_ID }}
ALL_COMMITS: ${{ secrets.ALL_COMMITS }}
-
Click Start commit then Commit new file to save
That's it! You Gist will be updated immediately, and every hour after that