โ๏ธ 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โ
| Name | Description | Required | Default |
|---|---|---|---|
| api-key | Early AI API key for backend access. | โ Yes | โ |
| token | GitHub token for repo access and commits. See token docs. | โ Yes | GITHUB_TOKEN |
โ๏ธ Optional Inputsโ
| Name | Description | Default |
|---|---|---|
| test-structure | Where to place tests: siblingFolder or rootFolder | siblingFolder |
| test-framework | Target test framework (jest only for now) | jest |
| test-file-suffix | Suffix like test or spec | test |
| test-file-naming | camelCase, kebabCase, etc. | camelCase |
| max-concurrency | 1โ4 workers. See concurrency guide. | 4 |
| auto-commit | true/false โ whether to push files automatically | true |
| coverage-command | Custom coverage command โ must keep Early flags | See Agent Jest Commands โ |
| test-command | Custom validation command โ must keep Early flags | See Agent Jest Commands โ |
| continue-on-test-errors | continue the operation if current tests fail. | See Agent Jest Commands - tests fail โ |
| lint-command | ESLint command before commit (see lint guide) | npx --no eslint $early_filename --fix |
| prettier-command | Prettier command before commit (see format guide) | npx --no prettier $early_filename --write |
๐ค Outputsโ
| Output Name | Description |
|---|---|
| pre-coverage | Coverage before test generation |
| post-coverage | Coverage 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 sourcerootFolderโ test files placed under a root/testsfolder
๐งช 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
๐ Recommended Triggersโ
We recommend:
openedโ when PR is first createdready_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-commitenabled โ only valid files are pushed - Always define
NODE_OPTIONS - Use
lint-commandandprettier-commandto prevent CI/pre-commit errors - Tune
max-concurrencyif hitting memory limits
๐ Next: Troubleshooting