๐
Type-Safe Validation
Full TypeScript support with Zod v4 schemas for all 43 GitHub Actions environment variables
Environment variable validation with IntelliSense, Zod v4 metadata, and workflow command helpers
import { addSummary, setOutput, validateEnv } from "@kjanat/gha-env-validator";
// Validate GitHub Actions environment
const env = validateEnv();
// Type-safe access with IntelliSense
console.log(env.GITHUB_SHA); // string
console.log(env.GITHUB_RUN_ID); // number
console.log(env.RUNNER_OS); // "Linux" | "Windows" | "macOS"
// Use workflow commands
setOutput("commit", env.GITHUB_SHA.substring(0, 7));
addSummary("Build", `โ
Deployed to ${env.RUNNER_OS}`);npm install @kjanat/gha-env-validator zodbun add @kjanat/gha-env-validator zodyarn add @kjanat/gha-env-validator zodpnpm add @kjanat/gha-env-validator zod