Skip to content

maxchang3/github-lang-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

็ฎ€ไฝ“ไธญๆ–‡

๐Ÿ’ป๐Ÿ“Œ Update a pinned gist to show your most used programming languages

Fork of Aveek-Saha/lang-stats-box with enhancements.

github-lang-box

npm GitHub Workflow Status Checked with Biome License

โœจ 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 or pnpx
  • โœ… 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.

Usage

Use as a CLI

# 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

GitHub Action Setup

Prerequisites

  1. Create a new public GitHub Gist at https://gist.github.com/
  2. Generate an access token with gist and metadata:read scopes at https://github.com/settings/tokens?type=beta

Workflow Configuration

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

Add Repository Secrets and Variables

  1. Go to your repository Settings > Secrets and variables > Actions.
  2. Add a repository secret:
    • GH_TOKEN: Your GitHub access token (requires gist and metadata:read scopes).
  3. (Optional) Add repository variables as needed (EXCLUDE, EXCLUDE_REPO).

Credits

About

๐Ÿ’ป๐Ÿ“Œ Update a pinned gist to show your most used languages

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •