Installation
Requirements
- Node.js: 18.0.0 or higher
- TypeScript: 5.0 or higher (peer dependency)
- Zod: 4.x (dependency)
Package Manager
bash
npm install @kjanat/gha-env-validator zodbash
bun add @kjanat/gha-env-validator zodbash
yarn add @kjanat/gha-env-validator zodbash
pnpm add @kjanat/gha-env-validator zodTypeScript Configuration
Make sure your tsconfig.json has these settings for optimal experience:
json
{
"compilerOptions": {
"strict": true,
"moduleResolution": "bundler",
"types": ["node"]
}
}Verify Installation
Create a test file to verify everything works:
typescript
// test.ts
import { validateEnv } from "@kjanat/gha-env-validator";
// This will throw if not in GitHub Actions
// but demonstrates the import works
console.log("Package installed successfully!");Run with:
bash
bun test.ts
# or
npx tsx test.ts