1414"""
1515
1616import os
17- import sys
1817import pathlib
18+ import sys
1919from typing import Optional
2020
2121
@@ -28,7 +28,7 @@ def replace_in_file(file_path: pathlib.Path, old_text: str, new_text: str) -> No
2828 content = file_path .read_text ()
2929 except UnicodeDecodeError :
3030 # If that fails, try with UTF-8
31- encoding = ' utf-8'
31+ encoding = " utf-8"
3232 content = file_path .read_text (encoding = encoding )
3333
3434 # Perform the replacement
@@ -54,7 +54,7 @@ def find_repo_root() -> Optional[pathlib.Path]:
5454
5555 while current_path != current_path .parent :
5656 # Check if .git directory exists
57- git_dir = current_path / ' .git'
57+ git_dir = current_path / " .git"
5858 if git_dir .exists () and git_dir .is_dir ():
5959 return current_path
6060
@@ -86,15 +86,15 @@ def main() -> None:
8686 print (f"Repository root found at: { repo_root } " )
8787
8888 # Get path to workflow directory
89- workflow_dir = repo_root / ' .github' / ' workflows'
89+ workflow_dir = repo_root / " .github" / " workflows"
9090
9191 # Process all workflow files and perform both replacements on each file
92- for yml_file in workflow_dir .glob (' *.yml' ):
93- replace_in_file (yml_file , ' @main' , f' @release/{ version } ' )
94- replace_in_file (yml_file , ' test-infra-ref: main' , f' test-infra-ref: release/{ version } ' )
92+ for yml_file in workflow_dir .glob (" *.yml" ):
93+ replace_in_file (yml_file , " @main" , f" @release/{ version } " )
94+ replace_in_file (yml_file , " test-infra-ref: main" , f" test-infra-ref: release/{ version } " )
9595
9696
9797if __name__ == "__main__" :
9898 print ("Starting YML updates..." )
9999 main ()
100- print ("YML updates completed." )
100+ print ("YML updates completed." )
0 commit comments