Skip to content
Snippets Groups Projects
Unverified Commit 0cb45ddb authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

feat: ENV_PREFIX (#9397)

parent 553bd996
No related branches found
No related tags found
No related merge requests found
......@@ -208,6 +208,8 @@ If you are configuring using environment variables, there are two possibilities:
If you combine both of the above then any single config option in the environment variable will override what's in `RENOVATE_CONFIG`.
Note: it's also possible to change the default prefix from `RENOVATE_` using `ENV_PREFIX`. e.g. `ENV_PREFIX=RNV_ RNV_TOKEN=abc123 renovate`.
## Authentication
Regardless of platform, you need to select a user account for `renovate` to assume the identity of, and generate a Personal Access Token.
......
......@@ -6,6 +6,15 @@ import { logger } from '../logger';
import { getOptions } from './definitions';
import type { GlobalConfig, RenovateOptions } from './types';
// istanbul ignore if
if (process.env.ENV_PREFIX) {
for (const [key, val] of Object.entries(process.env)) {
if (key.startsWith(process.env.ENV_PREFIX)) {
process.env[key.replace(process.env.ENV_PREFIX, 'RENOVATE_')] = val;
}
}
}
export function getEnvName(option: Partial<RenovateOptions>): string {
if (option.env === false) {
return '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment