← knowledge.oriz.in

Lines of Code badge (GitHub Action)

service servicescode-qualitycode-statsbadgereadmegithub-actionsauto-tracking

Lines of Code badge (GitHub Action)

Role

A GitHub Action runs on every push to main, recomputes the repo's total line count, regenerates an SVG badge, and commits the badge back to the repo. The badge is referenced from each README's heading block alongside the existing quality / coverage badges:

<!-- TODO: broken link, was [![Lines of Code](.github/badges/lines-of-code.svg) -->](#)

Every repo's README ships the badge by default via templates/per-site-ci/; new family repos pick it up automatically.

Free tier

Free OSS Action, runs on the family's existing GitHub Actions free public-repo minutes — unlimited under the public-everywhere posture.

Card / subscription required?

NO. GitHub Action; consumes Actions free minutes.

Alternatives

Swap cost

Low. Replace the Action workflow YAML; the badge consumer (README markdown) doesn't change.

Why this is our pick

The 9-tool code-stats stack (decision) asks for a visible line-count signal in every repo's README — a self-committing GitHub Action gives that for free, without depending on a remote SVG host or a third-party badge service.

Composes with Tokei for the canonical line count + the family-wide /stats page for the cross-repo aggregate view. The badge is the per-repo glance; /stats is the family-wide dashboard.

Auto-tracked end-to-end: badge regenerates on every push without human action, in line with the auto-only-tracking rule.

Cross-refs