๐ป๐ Update a pinned gist to show your most used programming languages
Fork of Aveek-Saha/lang-stats-box with enhancements.
- ๐ Uses
/user/repos
endpoint to fetch all repositories (including private ones) - ๐จ Supports custom descriptions, language exclusions, and repository filtering
- ๐ฆ Published to npm with binary support for easy use via
npx
orpnpx
- โ Updated dependencies and completely rewritten in TypeScript
Important
Since this package uses the /user/repos
endpoint, Fine-grained access tokens must have the metadata:read
permission.
# Run directly with npx/pnpx
npx github-lang-box [options]
# Or install globally
npm install -g github-lang-box
github-lang-box [options]
Options:
--dry
- Preview the output without updating the gist
Required Environment Variables:
Variable | Description |
---|---|
GH_TOKEN | GitHub access token with gist and metadata:read scopes |
GIST_ID | The ID from your gist URL: https://gist.github.com/username/ 8335e85451541072dd25fda601129f7d |
GH_USERNAME | Your GitHub username |
EXCLUDE | (Optional) Comma-separated list of languages to exclude Example: Jupyter Notebook,CSS,TeX,PHP |
EXCLUDE_REPO | (Optional) Comma-separated list of repositories to exclude Example: username/repo1,username/repo2 |
DESCRIPTION | (Optional) Custom description for the gist |
- Create a new public GitHub Gist at https://gist.github.com/
- Generate an access token with
gist
andmetadata:read
scopes at https://github.com/settings/tokens?type=beta
Create .github/workflows/lang-box.yml
in your repository
name: Update gist with most used programming languages
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
language-box:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 10
run_install: true
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Update
run: pnpm dlx github-lang-box@2
env:
GH_USERNAME: your-username
GIST_ID: your-gist-id
GH_TOKEN: ${{ secrets.GH_TOKEN }}
# You can also use hardcoded values instead of variables
# EXCLUDE: Jupyter Notebook,CSS,TeX,PHP
# EXCLUDE_REPO: username/repo1,username/repo2
EXCLUDE: ${{ vars.EXCLUDE }}
EXCLUDE_REPO: ${{ vars.EXCLUDE_REPO }}
DESCRIPTION: Your custom description
- Go to your repository Settings > Secrets and variables > Actions.
- Add a repository secret:
GH_TOKEN
: Your GitHub access token (requiresgist
andmetadata:read
scopes).
- (Optional) Add repository variables as needed (
EXCLUDE
,EXCLUDE_REPO
).
- Inspired by @matchai's bird-box
- Forked from @Aveek-Saha's lang-stats-box