{defaultDump}
)}
- {definition.description !== undefined && (
+ {description !== undefined && (
)}
diff --git a/src/components/Tables/TemplateVariablesTable.tsx b/src/components/Tables/TemplateVariablesTable.tsx
new file mode 100644
index 0000000000..3db0f174e5
--- /dev/null
+++ b/src/components/Tables/TemplateVariablesTable.tsx
@@ -0,0 +1,46 @@
+import configSchema from '../../util/sanitizedConfigSchema';
+import { extractTemplateVariables } from '../../util/templateVariables';
+
+import { ConfigSchema, Def } from './ConfigOptions';
+import { renderMarkdown } from './utils';
+
+interface TemplateVariablesTableProps extends Def {
+ field: string;
+}
+
+export default function TemplateVariablesTable({ def, field }: TemplateVariablesTableProps) {
+ const schema = configSchema as unknown as ConfigSchema;
+ const definition = schema.$defs[def]?.properties?.[field];
+ const variables = extractTemplateVariables(definition);
+
+ // Astro's React SSR rejects a component that conditionally returns null/undefined,
+ // so render an empty fragment (not null) when the field has no published variables
+ // — the graceful state before the engine schema with x-mergify-template-variables
+ // is synced into the docs.
+ if (variables.length === 0) {
+ return <>>;
+ }
+
+ return (
+ | Variable | +Description | +
|---|---|
+ {`{{ ${variable.name} }}`}
+ |
+ + |