fix: ignore .env in pipelines (#40327)
This commit is contained in:
committed by
GitHub
parent
6c5304980d
commit
24f57ca7c2
@ -1,11 +1,14 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const envPath = path.resolve(__dirname, '../.env');
|
||||
if (!fs.existsSync(envPath)) {
|
||||
throw Error('.env not found, please copy sample.env to .env.');
|
||||
// PIPELINE_ENV is 'true' in the build pipeline
|
||||
if (process.env.PIPELINE_ENV !== 'true') {
|
||||
const envPath = path.resolve(__dirname, '../.env');
|
||||
if (!fs.existsSync(envPath)) {
|
||||
throw Error('.env not found, please copy sample.env to .env.');
|
||||
}
|
||||
require('dotenv').config({ path: envPath });
|
||||
}
|
||||
require('dotenv').config({ path: envPath });
|
||||
|
||||
const {
|
||||
HOME_LOCATION: home,
|
||||
|
@ -43,6 +43,7 @@ PAYPAL_WEBHOOK_ID=webhook_id_from_paypal_dashboard
|
||||
# ---------------------
|
||||
# Build variants
|
||||
# ---------------------
|
||||
PIPELINE_ENV=false
|
||||
DEPLOYMENT_ENV='staging'
|
||||
FREECODECAMP_NODE_ENV='development'
|
||||
# Language to build
|
||||
|
Reference in New Issue
Block a user