fix: stabilize generated instructions README ordering (#1846)

Pass an explicit 'en' locale to localeCompare for instruction title
sorting in update-readme.mjs. Previously the default OS locale was
used, causing String.prototype.localeCompare to produce different
orderings on Windows vs Ubuntu (affecting characters like Korean and
Japanese CJK titles), which made the validate-readme CI workflow
non-deterministic.

Fixes the root cause of the locale-dependent sort instability.
This commit is contained in:
kimtth
2026-05-28 09:09:14 +09:00
committed by GitHub
parent 18526f2089
commit 78d62afc0c
+2 -2
View File
@@ -303,7 +303,7 @@ function generateInstructionsSection(instructionsDir) {
});
// Sort by title alphabetically
instructionEntries.sort((a, b) => a.title.localeCompare(b.title));
instructionEntries.sort((a, b) => a.title.localeCompare(b.title, "en"));
console.log(`Found ${instructionEntries.length} instruction files`);
@@ -673,7 +673,7 @@ function generateUnifiedModeSection(cfg) {
return { file, filePath, title: extractTitle(filePath) };
});
entries.sort((a, b) => a.title.localeCompare(b.title));
entries.sort((a, b) => a.title.localeCompare(b.title, "en"));
console.log(
`Unified mode generator: ${entries.length} files for extension ${extension}`
);