Loading...
Loading...
Add a GitHub Actions workflow that posts code-size and cost statistics — lines of code, per-language breakdown, complexity, and a COCOMO "what would this cost to build" estimate — as a sticky comment on every pull request, using scc. Use when you want a per-PR code-stats or "worth of the codebase" comment, to show LOC / language breakdown or an estimated development cost/effort on PRs, to set up scc (Sloc Cloc and Code) in CI, to post or upsert a single self-updating bot comment from GitHub Actions, or to change the COCOMO salary/currency. Covers fork-PR token limits, runner architecture, version pinning, and comment pagination.
npx skill4agent add stealth-factory/skills code-complexity-stats-prscctemplates/code-complexity.ymlscc--avg-wagetemplates/code-complexity.yml.github/workflows/code-complexity.ymlubuntu-latestAVG_WAGEWAGE_LABELpull_request: [opened, synchronize, reopened][skip ci]pull-requests: writeissues: write<!-- code-complexity -->cancel-in-progress: truegithub.event.pull_request.numberhead_refscc --avg-wage <annual>AVG_WAGE360000WAGE_LABELenv| Want to… | Change |
|---|---|
| Use a different currency / salary | the |
| Exclude more build/generated dirs | |
| Pin / upgrade scc | |
| Run on ARM runners | swap the tarball to |
| Count only part of a monorepo | add a path arg to |
pull_requestpull-requests: writeif: github.event.pull_request.head.repo.full_name == github.repositorypull_requestscc-output.txtworkflow_runpull_request_target--by-filelatestlatestSCC_VERSIONSCC_SHA256sha256sum -cchecksums.txtscc_Linux_x86_64.tar.gz_arm64github.paginate(...)startsWithincludesGH_TOKEN || github.tokenGH_TOKENgithub.tokenGITHUB_TOKENgithub.tokensecrets.GITHUB_TOKENcode-complexity.ymlpersist-credentials: falseubuntu-latest