From 75f43379573b4858e37cc6f277c6783c2fdccbf5 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Fri, 12 Dec 2025 17:10:31 +0200 Subject: [PATCH] scripts/set-alias-page.py: fix "page updated" spam when it wasn't being updated (#19941) --- scripts/set-alias-page.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/set-alias-page.py b/scripts/set-alias-page.py index 884d7da79e..a76fab902b 100755 --- a/scripts/set-alias-page.py +++ b/scripts/set-alias-page.py @@ -269,14 +269,19 @@ def get_alias_command_in_page(path: Path, alias_pattern: str) -> AliasPageConten if len(command_lines) != 2 or not title: return AliasPageContent(title="", original_command="", documentation_command="") - stripped_template = config.templates["en"].replace("example", "") - stripped_en = content - stripped_en = re.sub(r"#.*", "# ", stripped_en) - stripped_en = re.sub(r"`(?!tldr).*`", "``", stripped_en) - stripped_en = re.sub(r"`tldr .*`", "`tldr `", stripped_en) + if alias_pattern == get_locale_alias_pattern("en"): + stripped_template = config.templates["en"] + stripped_template = stripped_template.replace("example", "") - if stripped_template != stripped_en: - return AliasPageContent(title="", original_command="", documentation_command="") + stripped_en = content + stripped_en = re.sub(r"#.*", "# ", stripped_en) + stripped_en = re.sub(r"`(?!tldr).*`", "``", stripped_en) + stripped_en = re.sub(r"`tldr .*`", "`tldr `", stripped_en) + + if stripped_template != stripped_en: + return AliasPageContent( + title="", original_command="", documentation_command="" + ) original_command = "" documentation_command = ""