Files
Jamie Tanna b39b50f559 chore: expose known environment variables (#42201)
To provide more programmatic means to determine what environment
variables configure Renovate configuration options - and whether they're
Repo, Inherit or Global config options - we can expose these in two
forms:

- `getEnvOptionsMap()`
- a static JSON file, `renovate-env-options.ts`

This will provide programmatic use-cases from a plain JSON file that can
be used more readily - especially as it's distributed in the docs and
built package - as well as a function that can be used by users of
Renovate-as-a-library.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-14 15:27:50 +00:00

14 lines
468 B
TypeScript

import { getEnvOptionsMap } from '../../lib/config/options/env-options.ts';
import { prettier } from '../../lib/expose.ts';
import { updateFile } from '../utils/index.ts';
export async function generateEnvOptions(dist: string): Promise<void> {
const map = getEnvOptionsMap();
const config = await prettier().format(JSON.stringify(map), {
filepath: 'renovate-env-options.json',
});
await updateFile(`${dist}/renovate-env-options.json`, `${config}\n`);
}