Skip to content

Add the envguard-ci command - #5

Merged
Gulliby merged 1 commit into
mainfrom
feature/envguard-ci-command
Oct 18, 2026
Merged

Gulliby merged 1 commit into
mainfrom
feature/envguard-ci-command

Conversation

@Gulliby

@Gulliby Gulliby commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Requested by gulliby

Before. In a GitHub Actions step the usual call is envguard --github --strict, so that every problem, extra keys included, becomes an error annotation. There was no command that does this without flags.

After. The package has a second bin, envguard-ci, which behaves exactly like envguard --github --strict with the same options and exit codes (--json is rejected as with --github). bun run build now writes both dist/cli.js and dist/ci.js. With .env.example containing A=, B=, C= and .env containing A=1, C=, CI=true, node dist/ci.js prints and exits with 1:

::error file=.env,title=envguard::Missing key B (required by .env.example)
::error file=.env,title=envguard::Empty value for key C
::error file=.env,title=envguard::Extra key CI (not in .env.example)

How. New src/ci.ts inserts --github --strict into the arguments and loads ./cli. package.json gets the second bin entry and the build script bun build src/cli.ts src/ci.ts --outdir dist --target node. New tests/ci.test.ts has five tests; in tests/project.test.ts the assertion on the build script is updated and the new bin entry is checked. The README gets a "CI command" section. 170 tests pass; typecheck, lint and build are clean.

envguard-ci runs envguard with --github and --strict already switched on. The package gets a second bin entry and the build script writes both dist/cli.js and dist/ci.js.
@Gulliby Gulliby self-assigned this Oct 18, 2026
@Gulliby
Gulliby merged commit 9cf9fa9 into main Oct 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant