Skip to main content

โš™๏ธ Configuration Options โ€” GitHub Action for Pull Requests

This page lists all configuration inputs and behavior for the Early-Catch GitHub Action on pull requests.

For shared concepts like tokens, memory, linting, concurrency, and SCM setup, see:


๐Ÿ”‘ Required Inputsโ€‹

NameDescriptionRequiredDefault
api-keyEarly AI API key for backend access.โœ… Yesโ€“
tokenGitHub token for repo access and commits. See token docs.โœ… YesGITHUB_TOKEN

โš™๏ธ Optional Inputsโ€‹

NameDescriptionDefault
test-structureWhere to place tests: siblingFolder or rootFoldersiblingFolder
test-frameworkTarget test framework (jest only for now)jest
test-file-suffixSuffix like test or spectest
test-file-namingcamelCase, kebabCase, etc.camelCase
max-concurrency1โ€“4 workers. See concurrency guide.4
auto-committrue/false โ€” whether to push files automaticallytrue
coverage-commandCustom coverage command โ€” must keep Early flagsSee Agent Jest Commands โ†’
test-commandCustom validation command โ€” must keep Early flagsSee Agent Jest Commands โ†’
continue-on-test-errorscontinue the operation if current tests fail.See Agent Jest Commands - tests fail โ†’
lint-commandESLint command before commit (see lint guide)npx --no eslint $early_filename --fix
prettier-commandPrettier command before commit (see format guide)npx --no prettier $early_filename --write

๐Ÿ“ค Outputsโ€‹

Output NameDescription
pre-coverageCoverage before test generation
post-coverageCoverage after test generation

๐Ÿง  Memory Recommendationโ€‹

Set this in the env: section of your job:

NODE_OPTIONS: "--max-old-space-size=5120"

Required when using default concurrency (4). See Memory Tuning for limits per runner.


๐Ÿ“‚ Placement: test-structureโ€‹

  • siblingFolder โ†’ test files placed next to source
  • rootFolder โ†’ test files placed under a root /tests folder

๐Ÿงช Framework: test-frameworkโ€‹

Currently only jest is supported.
Support for mocha and vitest is planned.


๐Ÿงน Lint & Format Commandsโ€‹

If your repository enforces code style, prettier formatting, or pre-commit linting,
you may need to configure test generation agents to run those tools automatically.

Early CLI agents have built-in defaults for linting and formatting:

lint-command: npx --no eslint $early_filename --fix  
prettier-command: npx --no prettier $early_filename --write

These are the same commands described below. If your repository uses different commands (e.g., via hooks or custom scripts), you should override these defaults accordingly.


๐Ÿง  Advanced Commandsโ€‹

If customizing test or coverage commands, you must keep all required Early flags.

TBD


We recommend:

  • opened โ€” when PR is first created
  • ready_for_review โ€” when draft is finalized

Avoid push or synchronize unless you want re-generation on every commit.


๐Ÿงฉ Example Configuration Blockโ€‹

with:
api-key: ${{ secrets.EARLY_SECRET_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
test-framework: jest
test-structure: rootFolder
test-file-suffix: spec
test-file-naming: kebabCase
auto-commit: true
lint-command: npx --no eslint $early_filename --fix
prettier-command: npx --no prettier $early_filename --write

โœ… Best Practicesโ€‹

  • Keep auto-commit enabled โ€” only valid files are pushed
  • Always define NODE_OPTIONS
  • Use lint-command and prettier-command to prevent CI/pre-commit errors
  • Tune max-concurrency if hitting memory limits

๐Ÿ‘‰ Next: Troubleshooting