From 78d62afc0c6a84190d9b8dd824b1071ec09c88fe Mon Sep 17 00:00:00 2001 From: kimtth Date: Thu, 28 May 2026 09:09:14 +0900 Subject: [PATCH] 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. --- eng/update-readme.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/update-readme.mjs b/eng/update-readme.mjs index 147a91c1..1a80cedd 100644 --- a/eng/update-readme.mjs +++ b/eng/update-readme.mjs @@ -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}` );