Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 2.08 KB

File metadata and controls

82 lines (65 loc) · 2.08 KB

Simple Language Stats

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

37.33% ==    JavaScript
 24.2% =     Fluent
14.12% =     TypeScript
 7.76% =     Python
  6.1% =     TeX
 3.62% =     Astro
 2.34% =     CSS
 1.48% =     MDX
 1.36% =     BibTeX Style
  0.9% =     HTML
 0.24% =     Julia
 0.19% =     Shell
 0.13% =     HCL
 0.09% =     Typst
 0.05% =     XSLT
 0.04% =     Ruby
 0.03% =     PowerShell
 0.01% =     Perl
 0.01% =     Batchfile

Based on 20 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
        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