gh-statskit
v0.0.0-alpha.1
Published
A CLI to export GitHub stats and publish to a GitHub Gist.
Maintainers
Readme
GitHub Statskit
A CLI tool to export your GitHub stats and publish to a GitHub Gist. Automatically sync your contribution data to a Gist for easy sharing and tracking.
Usage
Local usage
Run the tool locally to export your stats:
export GH_PAT=your_github_token
# Export to local file
npx gh-statskit
# Update to Gist
npx gh-statskit --gist-id idGitHub CI usage
[!IMPORTANT] Your Gist must already exist and contain a file with the specified filename (default:
github-stats.json). You can customize the filename using the--gist-filenameoption.
Set up GitHub Actions to automatically sync your stats on a schedule:
name: Upload GitHub Stats
on:
push:
branches: [main]
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Update to Gist
run: npx gh-statskit
env:
GH_PAT: ${{ secrets.GH_PAT }}
GIST_ID: ${{ secrets.GIST_ID }}Configure secrets in your repository:
- Go to your repository Settings > Secrets and variables > Actions
- Add
GH_PATas a repository secret (your GitHub Personal Access Token) - Add
GIST_IDas a repository secret (the ID of your Gist containing the configured filename, default:github-stats.json)
Credits
This project is inspired by:
- releases.antfu.me - @Anthony Fu
- my-pull-requests - @Sébastien Chopin
- github-readme-stats - @anuraghazra
License
MIT License © jinghaihan
