Skip to content

Commit

Permalink
fix: in CI environments default to .env.example
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhenry committed Feb 22, 2024
1 parent 0d0dd74 commit adc13fe
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
9 changes: 9 additions & 0 deletions env.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { createEnv } from '@t3-oss/env-nextjs'
import isCI from 'is-ci'
import { z } from 'zod'

// This is to make builds play nicely on CI
if (isCI) {
console.log('Running on CI, using .env.example file.')
require('dotenv').config({
path: '.env.example',
})
}

export const env = createEnv({
/*
* Serverside Environment variables, not available on the client.
Expand Down
12 changes: 11 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"zod": "3.22.4"
},
"devDependencies": {
"@types/is-ci": "3.0.4",
"@types/jest": "29.5.11",
"@types/node": "20.11.19",
"@types/node-fetch": "2.6.9",
Expand All @@ -54,7 +55,7 @@
"eslint": "8.56.0",
"eslint-config-next": "14.1.0",
"husky": "9.0.11",
"is-ci": "^3.0.1",
"is-ci": "3.0.1",
"jest": "29.7.0",
"lint-staged": "15.2.2",
"nock": "13.4.0",
Expand Down

0 comments on commit adc13fe

Please sign in to comment.