Skip to content

ChrisGVE/codesize-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

codesize-action

GitHub Marketplace

GitHub Action for codesize — reports files and functions that exceed per-language line-count limits, using tree-sitter for accurate function boundary detection.

Usage

- uses: ChrisGVE/codesize-action@v1

By default the action:

  • scans the repository root
  • respects .gitignore
  • writes violations to codesize.csv
  • exits with status 1 if any violations are found

Basic example

name: Code size check
on: [push, pull_request]

jobs:
  codesize:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ChrisGVE/codesize-action@v1

Upload the CSV as an artifact

steps:
  - 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 }}

Warn only (no build failure)

- uses: ChrisGVE/codesize-action@v1
  with:
    fail: 'false'

Allow headroom while cleaning up a backlog

- uses: ChrisGVE/codesize-action@v1
  with:
    tolerance: '20'   # 20 % above every limit before flagging

Inputs

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

Outputs

Output Description
violations Number of violations found
csv Path to the CSV output file

License

MIT — see LICENSE.

About

GitHub Action to report code size violations using codesize

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors