UNPKG

github-action-readme-generator

Version:

This is a CLI tool and GitHub Action that reads in the details from a GitHub Action's `action.yml` file and updates the `README.md` file with the `name`, `description`, `usage`, `inputs`, `outputs`, and examples of the action. Configuration can be provid

51 lines (50 loc) 1.38 kB
import { ReadmeSection } from './constants.js'; import Inputs from './inputs.js'; import LogTask from './logtask/index.js'; export type SectionKV = Record<string, string>; /** * Class for managing README generation. */ export declare class ReadmeGenerator { /** * The Inputs instance. */ private inputs; /** * The Logger instance. */ private log; /** * Initializes the ReadmeGenerator. * * @param inputs - The Inputs instance * @param log - The Logger instance */ constructor(inputs: Inputs, log: LogTask); /** * Updates the README sections. * * @param sections - The sections array * @returns Promise array of section KV objects */ updateSections(sections: ReadmeSection[]): Promise<SectionKV>[]; /** * Resolves the section update promises. * * @param promises - The promise array * @returns Promise resolving to combined sections KV */ resolveUpdates(promises: Promise<SectionKV>[]): Promise<SectionKV>; /** * Outputs the sections KV to GitHub output. * * @param sections - The sections KV */ outputSections(sections: SectionKV): void; /** * Generates the README documentation. * * @returns Promise resolving when done */ generate(providedSections?: ReadmeSection[]): Promise<void>; }