Theo's Typesafe CultTTC
Theo's Typesafe Cult8mo ago
8 replies
its.elite

Stop t3-env from asking for env in github actions

Title^^
My ci/cd to vercel is failing as it’s asking me to add my variables to the secrets, but I don’t wanna do that


Do I add them to skip validation??
Solution
Try the following configuration

src/env.ts - config
import { z } from 'zod';
import { createEnv } from "@t3-oss/env-nextjs";

export const env = createEnv({
  …existingConfig
  emptyStringAsUndefined: true,
  experimental_runtimeEnv: process.env,
  skipValidation: !!process.env.SKIP_ENV_VALIDATION,
});


Ensure the process.env.SKIP_ENV_VALIDATION is a boolean value

.github/workflows/ci.yml - workflow file
- name: Run Build
        run: npm build
        env:
          SKIP_ENV_VALIDATION: true
Was this page helpful?