Closed rikhall1515 closed 2 months ago
T3-Env works perfectly on dev and prod but not on github actions. For context, my next.config.mjs file is configured with jiti as per the documentation.
dev
prod
next.config.mjs
jiti
Here is a link where you can see the output. Here is the image for a quick preview:
Here you can see the environment variables in the workflow file.
Here below you can see that the repository has the correct environment variables set that are affected:
Here is the configuration of env/client.ts that is associated with the error output:
env/client.ts
import { createEnv } from "@t3-oss/env-nextjs"; import { z } from "zod"; export const env = createEnv({ isServer: typeof window === "undefined", client: { NEXT_PUBLIC_BASE_URL: z.string().url(), NEXT_PUBLIC_SITE_NAME: z.string(), }, runtimeEnv: { NEXT_PUBLIC_BASE_URL: process.env.NEXT_PUBLIC_BASE_URL, NEXT_PUBLIC_SITE_NAME: process.env.NEXT_PUBLIC_SITE_NAME, }, });
What's the easiest way of dealing with this that also maintains good security practices for environment variables?
Found out how to fix it, just use repo secrets instead.
Description
T3-Env works perfectly on
dev
andprod
but not on github actions. For context, mynext.config.mjs
file is configured withjiti
as per the documentation.Here is a link where you can see the output. Here is the image for a quick preview:![screen-11 39 14 20 04 2024](https://github.com/t3-oss/t3-env/assets/30295873/f8a20d95-4590-41d4-a537-2319bc5e0b31)
Here you can see the environment variables in the workflow file.
Here below you can see that the repository has the correct environment variables set that are affected:![screen-11 34 44 20 04 2024](https://github.com/t3-oss/t3-env/assets/30295873/dd5d2187-30d9-480f-baf9-e93b90420e63)
Here is the configuration of
env/client.ts
that is associated with the error output:Question
What's the easiest way of dealing with this that also maintains good security practices for environment variables?
Edit
Found out how to fix it, just use repo secrets instead.