| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A fully automated GitHub repository analyzer that counts lines of code across all your repositories and updates stats dynamically. Runs on the default branch of each repo and skips forks.
[ LANGUAGES BREAKDOWN ] [ TOTAL LINES OF CODE: 0 ]
Stats update automatically via GitHub Actions.
This GitHub Action automatically fetches all your public repositories (excluding forks), clones the default branch, and analyzes lines of code using cloc. It then updates the repository’s README.md with the latest code statistics. The workflow runs by default every Sunday at midnight UTC (customizable), keeping your stats up to date.
Add the Workflow File
Copy the analyze-code.yml file into your repository at:
.github/workflows/analyze-code.yml
Then commit and push the changes.
Customize Language Output
To customize which languages are shown or excluded, visit lines 59 and 60 of analyze-code.yml and edit the INCLUDE_LANGUAGES and EXCLUDE_LANGUAGES variables as needed.
Languages not listed in INCLUDE_LANGUAGES and not excluded by EXCLUDE_LANGUAGES will be counted together and displayed as "Other languages" in the breakdown.
Update GitHub Username
Make sure to update the workflow file with your GitHub username wherever required.
Generate a GitHub Personal Access Token (PAT)
You need a Personal Access Token (PAT) with repo permissions.
Refer to GitHub Docs on how to generate one.
Add the Token to Repository Secrets
Update Workflow Permissions
In the repository where you're running the action, make sure to update workflow permissions:
Trigger the Workflow
on:
push:
branches:
- mainWait for Processing
The time taken depends on the number of repositories and their sizes. Once completed, your README.md will be updated with the latest lines of code breakdown.
Ensure Placeholders Are Present
To allow automatic updates, your README.md must include the following placeholders:
<!-- LANGUAGES BREAKDOWN (STATIC EXAMPLE) START --> <!-- LANGUAGES BREAKDOWN (STATIC EXAMPLE) END -->
The workflow will update the stats between these markers.
Remove (STATIC EXAMPLE) when adding it in your README, as it's just a placeholder. It's included here only to prevent automatic updates in this README.
By default, the workflow excludes some file types from counting:
cloc . --exclude-ext=json,html,css,svg,md,py,ps1,scss --json > ../output/cloc-output.jsonYou can modify this list in the workflow file to include or exclude specific languages based on your needs.
After execution, you can check the cloc-output.json file inside the output folder to see the full language breakdown.
For a complete list of supported languages, refer to cloc documentation.
Soon, I'll be pushing changes to configure workflow execution based on a JSON configuration.
This will allow you to:
This feature will be updated shortly.
Contributions are welcome! Feel free to fork the repository, submit a PR, or open an issue.
| Back | FazBrowse Home | New Git URL |