mirror of
https://github.com/github/awesome-copilot.git
synced 2026-05-30 02:21:46 +00:00
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:
@@ -303,7 +303,7 @@ function generateInstructionsSection(instructionsDir) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Sort by title alphabetically
|
// 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`);
|
console.log(`Found ${instructionEntries.length} instruction files`);
|
||||||
|
|
||||||
@@ -673,7 +673,7 @@ function generateUnifiedModeSection(cfg) {
|
|||||||
return { file, filePath, title: extractTitle(filePath) };
|
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(
|
console.log(
|
||||||
`Unified mode generator: ${entries.length} files for extension ${extension}`
|
`Unified mode generator: ${entries.length} files for extension ${extension}`
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user