Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,11 @@ export default class Inputs {
'sections',
inputContext.sections ?? (this.config.get('sections') as ReadmeSection[]),
);
this.sections = this.config.get('sections') as ReadmeSection[];
const configuredSections: unknown = this.config.get('sections');
if (!Array.isArray(configuredSections) || !configuredSections.every((section: unknown) => typeof section === 'string')) {
Comment thread
Jamie-BitFlight marked this conversation as resolved.
throw new Error('Invalid sections configuration: expected an array of section names');
}
this.sections = configuredSections as ReadmeSection[];
this.readmePath =
inputContext.readmePath ?? path.resolve(this.config.get(ConfigKeys.pathsReadme) as string);
this.readmeEditor = inputContext.readmeEditor ?? new ReadmeEditor(this.readmePath);
Expand Down
Loading