Follow these steps to enable language statistics tracking across all your repositories (public and private):
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Fill in the details:
- Note:
Language Statistics(or any descriptive name) - Expiration: Choose your preferred expiration (90 days recommended for security)
- Select scopes:
- ✅
repo- Full control of private repositories (Required) - ✅
read:user- Read user profile data (Optional)
- ✅
- Note:
- Click "Generate token"
- IMPORTANT: Copy the token immediately - you won't be able to see it again!
- Go to your profile repository:
https://github.com/narain1/narain1 - Click Settings (repository settings, not your account settings)
- In the left sidebar, click Secrets and variables → Actions
- Click "New repository secret"
- Fill in:
- Name:
GH_PAT(exactly as shown - this name is used by the workflow) - Secret: Paste your personal access token from Step 1
- Name:
- Click "Add secret"
You can manually trigger the workflow to test it:
- Go to the Actions tab in your repository
- Click on "Update Language Statistics" in the left sidebar
- Click "Run workflow" button
- Select the branch (usually
main) - Click "Run workflow"
The workflow will:
- Fetch all your repositories (public and private)
- Clone each repository temporarily
- Analyze all commits for language statistics
- Update your README with the results
- Commit and push the changes
This may take several minutes depending on how many repositories you have.
After the workflow completes:
- Check your README.md - it should now show statistics from all your repositories
- Review the workflow logs to see which repositories were analyzed
- The statistics will show your total lines of code across all languages
- ✅ All repositories where you are the owner
- ✅ Both public and private repositories
- ✅ All commits in all branches
- ✅ All programming languages (40+ supported)
- ❌ Forked repositories (skipped to avoid double-counting)
Once set up, the workflow automatically runs:
- When you push to the main branch
- When pull requests are merged
- Every Sunday (weekly update)
- Anytime you manually trigger it
If your statistics stop updating after a while, your token may have expired. Generate a new token and update the GH_PAT secret.
Ensure your token has the repo scope enabled. Without it, only public repositories will be analyzed.
Check the Actions tab for error messages. Common issues:
- Token not set correctly (check secret name is exactly
GH_PAT) - Token doesn't have required permissions
- Rate limiting (workflow will retry automatically)
- Never share or commit your personal access token
- Store it only in GitHub Secrets
- Use token expiration for better security
- Revoke and regenerate tokens if compromised
- The token is only used within GitHub Actions and never exposed
Check the detailed documentation in LANGUAGE_STATS.md for more information about how the system works and customization options.