https://github.com/botforge-pro/loc-graph-action
GitHub Action that visualizes your codebase growth — counts lines of code per commit and auto-updates an SVG chart you can embed in your README
https://github.com/botforge-pro/loc-graph-action
automation ci-cd code-metrics devops github-actions lines-of-code python svg-chart visualization
Last synced: 23 days ago
JSON representation
GitHub Action that visualizes your codebase growth — counts lines of code per commit and auto-updates an SVG chart you can embed in your README
- Host: GitHub
- URL: https://github.com/botforge-pro/loc-graph-action
- Owner: botforge-pro
- License: mit
- Created: 2025-08-09T22:36:09.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-09-03T10:23:08.000Z (5 months ago)
- Last Synced: 2025-09-03T12:23:44.519Z (5 months ago)
- Topics: automation, ci-cd, code-metrics, devops, github-actions, lines-of-code, python, svg-chart, visualization
- Language: Python
- Homepage:
- Size: 77.1 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/botforge-pro/loc-graph-action/actions/workflows/test.yml)
# LOC Graph Action
GitHub Action that scans your repository's commit history, calculates lines of code (LOC) for each commit, and produces an SVG chart showing how LOC changes over time. The generated SVG and a JSON cache are automatically committed back to the repository, allowing you to embed the chart directly in your README.
## Quick Setup
Create a workflow file `.github/workflows/loc-graph.yml`:
```yaml
name: LOC graph
on:
schedule:
- cron: '0 0 * * *' # Daily at midnight
workflow_dispatch:
permissions:
contents: write
jobs:
build-loc-graph:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: botforge-pro/loc-graph-action@main
```
After the workflow has run, add the following HTML snippet to the end of your README to display the LOC graph with automatic theme switching:
```html
### Lines of Code Over Time

```
## Advanced Setup
```yaml
name: LOC graph
on:
# Trigger on every push (mostly for testing)
push:
branches: [ main, master ]
# Trigger daily at midnight (recommended for active projects)
schedule:
- cron: '0 0 * * *'
# Allow manual triggering from the Actions tab
workflow_dispatch:
permissions:
contents: write
jobs:
build-loc-graph:
runs-on: ubuntu-latest
steps:
- name: Checkout full history
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate LOC graph
uses: botforge-pro/loc-graph-action@main
with:
output_json: "docs/data/loc-cache.json"
fallback_theme: dark # Theme for .github/loc-history.svg
date_format: "%Y-%m-%d" # 2024-03-15
time_format: "%I:%M %p" # 03:45 PM
exclude: ".cache,assets" # Additional names to exclude
```
## Live example
This repository uses its own action to track LOC over time:
