- Confluence Cloud API client with auth, CRUD, attachments, labels - Tree builder with glob matching, title extraction, hierarchy mapping - Markdown to Confluence Storage Format converter - Publisher orchestration with idempotent updates via content hash - CLI and GitHub Action stubs
21 lines
483 B
TypeScript
21 lines
483 B
TypeScript
/**
|
|
* Config loading for GitHub Action
|
|
*/
|
|
|
|
import { readFile } from 'node:fs/promises';
|
|
import { parse as parseYaml } from 'yaml';
|
|
import type { Config } from '@forma/publisher';
|
|
|
|
export async function loadConfig(configPath: string): Promise<Config> {
|
|
const content = await readFile(configPath, 'utf-8');
|
|
|
|
let parsed: unknown;
|
|
if (configPath.endsWith('.json')) {
|
|
parsed = JSON.parse(content);
|
|
} else {
|
|
parsed = parseYaml(content);
|
|
}
|
|
|
|
return parsed as Config;
|
|
}
|