@@ -58,28 +58,19 @@ def get_execution_link(os_name: str = None) -> str:
5858 return ""
5959
6060
61- def _get_os_execution_link_pattern (os_name ):
62- """Create regex pattern to match execution link lines exactly"""
63- import re
64-
65- return re .compile (
66- rf"^\s*\[{ re .escape (os_name )} \s+execution\s+link\]\(.*?\)\s*$" ,
67- re .IGNORECASE ,
68- )
69-
70-
7161def replace_link_in_description (description , os_name ) -> str :
7262 """Add or replace a test execution link in the test run description"""
73- logging .warning (f"Modifying plan description for %{ os_name } %" )
7463
75- description = description or ""
7664 link = get_execution_link (os_name )
7765 if not link :
7866 return description
7967
8068 new_line = f"[{ os_name } execution link]({ link } )"
81- lines = description .split ("\n " ) if description else []
82- pat = _get_os_execution_link_pattern (os_name )
69+ lines = description .splitlines ()
70+ pat = re .compile (
71+ rf"^\s*\[{ re .escape (os_name )} \s+execution\s+link\]\(.*?\)\s*$" ,
72+ re .IGNORECASE ,
73+ )
8374
8475 # Look for existing line to replace
8576 for i , line in enumerate (lines ):
@@ -99,17 +90,6 @@ def determine_current_os() -> str:
9990
10091 # Check if we're in GitHub Actions
10192 if os .environ .get ("GITHUB_ACTIONS" ):
102- # GitHub Actions provides RUNNER_OS environment variable
103- runner_os = os .environ .get ("RUNNER_OS" )
104- if runner_os :
105- if runner_os == "Windows" :
106- return "Windows"
107- elif runner_os == "macOS" :
108- return "Mac"
109- elif runner_os == "Linux" :
110- return "Linux"
111-
112- # Fallback to sys.platform if RUNNER_OS not available
11393 if sys .platform == "win32" :
11494 return "Windows"
11595 elif sys .platform == "darwin" :
0 commit comments