fix(core): Load config values from files using _FILE env variables (no-changelog) (#5335)

This broke in https://github.com/n8n-io/n8n/pull/5283/
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-02-02 14:01:55 +01:00 committed by GitHub
parent 8b09e98654
commit 6cba652ff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,9 +47,11 @@ if (!inE2ETests && !inTest) {
const overwrites = Object.entries(process.env).reduce<Record<string, string>>(
(acc, [envName, fileName]) => {
if (envName.endsWith('_FILE') && fileName) {
const key = envName.replace(/_FILE$/, '');
const configEnvName = envName.replace(/_FILE$/, '');
// @ts-ignore
if (key in config._env) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
const key = config._env[configEnvName]?.[0] as string;
if (key) {
let value: string;
try {
value = readFileSync(fileName, 'utf8').trim();