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 ```ts import { z } from 'zod';...
Jump to solution
6 Replies
Elite
EliteOP4mo ago
(would also need to match min char requirements and etc) if I added to secrets
Andrey Markin
Andrey Markin4mo ago
wasn’t there a special variable like SKIP_ENV_CHEK=1? so you can add it into command
Elite
EliteOP4mo ago
That skips it in dev and builds tho right
Solution
prudent
prudent4mo ago
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,
});
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
- name: Run Build
run: npm build
env:
SKIP_ENV_VALIDATION: true
prudent
prudent4mo ago
@Elite solution above ^^ don't forget to mark as solution
Elite
EliteOP4mo ago
ty will try it out

Did you find this page helpful?