mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-27 07:50:47 +00:00
e4c938b7a5
* docs: prepare release as asset * chore: cleanup * fix: wrong extension * fix: wrong logger * fix: wrong path * chore: clean and create tmp * chore: fix types * fix: update generation * Update .github/workflows/build.yml Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> * Update lib/datasource/types.ts Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import { allowedFields, exposedConfigOptions } from '../../lib/util/template';
|
|
import { readFile, updateFile } from '../utils';
|
|
import { replaceContent } from './utils';
|
|
|
|
export async function generateTemplates(dist: string): Promise<void> {
|
|
let exposedConfigOptionsText =
|
|
'The following configuration options are passed through for templating: ';
|
|
exposedConfigOptionsText +=
|
|
exposedConfigOptions
|
|
.map(
|
|
(field) => `[${field}](/configuration-options/#${field.toLowerCase()})`
|
|
)
|
|
.join(', ') + '.';
|
|
|
|
let runtimeText =
|
|
'The following runtime values are passed through for templating: \n\n';
|
|
for (const [field, description] of Object.entries(allowedFields)) {
|
|
runtimeText += ` - \`${field}\`: ${description}\n`;
|
|
}
|
|
runtimeText += '\n\n';
|
|
|
|
let templateContent = await readFile('docs/usage/templates.md');
|
|
templateContent = replaceContent(templateContent, exposedConfigOptionsText);
|
|
templateContent = replaceContent(templateContent, runtimeText);
|
|
await updateFile(`${dist}/templates.md`, templateContent);
|
|
}
|