What happens
src/sections/index.ts guards each section with:
const [startToken, stopToken] = inputs.readmeEditor.getTokenIndexes(section);
if (startToken === -1 || stopToken === -1) {
return {};
}
getTokenIndexes returns [] when a marker is missing, so both values are undefined and the guard never fires. Every configured section's updater runs whether or not the README has its markers.
Consequence
The README itself is safe, because updateSection finds no markers and writes nothing. The updater's other effects still happen:
updateBranding writes the SVG file and logs branding svg successfully created for a README with no branding section.
- The action's
sections output reports content for sections the README does not have.
Related
#644 asks for a warning when a section's markers are missing. This guard is where that check belongs, and today it never runs.
What happens
src/sections/index.tsguards each section with:getTokenIndexesreturns[]when a marker is missing, so both values areundefinedand the guard never fires. Every configured section's updater runs whether or not the README has its markers.Consequence
The README itself is safe, because
updateSectionfinds no markers and writes nothing. The updater's other effects still happen:updateBrandingwrites the SVG file and logsbranding svg successfully createdfor a README with no branding section.sectionsoutput reports content for sections the README does not have.Related
#644 asks for a warning when a section's markers are missing. This guard is where that check belongs, and today it never runs.