GitHub Action for codesize — reports files and functions that exceed per-language line-count limits, using tree-sitter for accurate function boundary detection.
- uses: ChrisGVE/codesize-action@v1By default the action:
- scans the repository root
- respects
.gitignore - writes violations to
codesize.csv - exits with status 1 if any violations are found
name: Code size check
on: [push, pull_request]
jobs:
codesize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ChrisGVE/codesize-action@v1steps:
- uses: actions/checkout@v4
- uses: ChrisGVE/codesize-action@v1
id: codesize
with:
fail: 'false' # report only, don't block the build
- uses: actions/upload-artifact@v4
if: always()
with:
name: codesize-report
path: ${{ steps.codesize.outputs.csv }}- uses: ChrisGVE/codesize-action@v1
with:
fail: 'false'- uses: ChrisGVE/codesize-action@v1
with:
tolerance: '20' # 20 % above every limit before flagging| Input | Default | Description |
|---|---|---|
version |
latest |
codesize release tag (e.g. v0.1.0) |
root |
. |
Directory to scan |
output |
codesize.csv |
CSV output path (ignored when stdout is true) |
stdout |
false |
Print CSV to stdout instead of a file |
tolerance |
0 |
Percent tolerance added to every limit |
gitignore |
true |
Honour .gitignore / .ignore files |
fail |
true |
Exit 1 if any violations are found |
| Output | Description |
|---|---|
violations |
Number of violations found |
csv |
Path to the CSV output file |
MIT — see LICENSE.