Skip to content

carolyn-sun/simple-lang-stats

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Simple Language Stats

Enjoy simplicity. A GitHub Action that automatically generates and updates language statistics in your README profile.

36.74% ==    JavaScript
 24.6% =     Fluent
14.92% =     TypeScript
 7.03% =     Python
 6.31% =     TeX
 3.54% =     CSS
 2.23% =     Astro
  1.4% =     BibTeX Style
 1.36% =     MDX
 0.94% =     HTML
 0.31% =     Swift
 0.25% =     Julia
 0.14% =     Shell
 0.08% =     Typst
 0.06% =     XSLT
 0.04% =     Ruby
 0.03% =     PowerShell
 0.01% =     Perl
 0.01% =     Batchfile

Based on 18 non-forked repositories for Carolyn Sun (carolyn-sun)
Powered by carolyn-sun/simple-lang-stats

Usage

Set a PAT secret in your repository settings in case you reach the API rate limit. Repo scope is sufficient.

Add this marker to your README.md where you want the language statistics to appear:

<!-- simple-lang-stats -->
<!-- /simple-lang-stats -->

The action will automatically insert your language statistics between these markers.

Then, add it to your workflow file (e.g., .github/workflows/update-stats.yml):

name: Update language stats

on:
  push:
  schedule:
    - cron: '0 */48 * * *'  # Run every 48 hours
  workflow_dispatch:  # Allow manual trigger

jobs:
  update-stats:
    runs-on: ubuntu-latest
    permissions:
      contents: write  # Allow writing to repository contents
      
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
        
      - name: Update Language Stats
        uses: carolyn-sun/simple-lang-stats@latest
        with:
          PAT: ${{ secrets.PAT }}
          username: ${{ github.repository_owner }}
          
      - name: Commit changes
        run: |
          git config --local user.email "action@github.com"
          git config --local user.name "GitHub Action"
          git add README.md
          git diff --staged --quiet || git commit -m "Update language statistics"
          git push

About

Enjoy simplicity. A GitHub Action that automatically generates and updates language statistics in your README profile.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors