File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ name : LOC Badge
2+
3+ on :
4+ push :
5+ branches : [main]
6+
7+ jobs :
8+ count-loc :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout code
12+ uses : actions/checkout@v3
13+
14+ - name : Install cloc
15+ run : |
16+ sudo apt-get update
17+ sudo apt-get install -y cloc
18+
19+ - name : Count lines with cloc
20+ run : |
21+ cloc . --csv --out=loc.csv
22+
23+ - name : Generate badge
24+ run : |
25+ CODE=$(tail -n 1 loc.csv | cut -d ',' -f5)
26+ echo "" > loc-badge.md
27+
28+ - name : Commit badge
29+ run : |
30+ git config --global user.name "github-actions"
31+ git config --global user.email "[email protected] " 32+ git add loc.csv loc-badge.md
33+ git commit -m "Update LOC badge" || echo "No changes to commit"
34+ git push
Original file line number Diff line number Diff line change 44![ License] ( https://img.shields.io/github/license/hellonearth311/statz )
55![ GitHub issues] ( https://img.shields.io/github/issues/hellonearth311/statz )
66![ Last Commit] ( https://img.shields.io/endpoint?url=https://github-last-commit-badge.vercel.app/lastcommit )
7+ [ ![ LOC] ( https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/main/loc-badge.md )] ( loc.csv )
78
89** statz** is a cross-platform Python package that fetches ** real-time system usage** and ** hardware specs** — all wrapped in a simple, clean API.
910
You can’t perform that action at this time.
0 commit comments