1010
1111
1212def cmd (command : list [str ]) -> str :
13- print ('$ %s' , ' ' .join (command ))
13+ print ('$ ' + ' ' .join (command ))
1414 process = subprocess .run (command , capture_output = True , text = True )
1515 if process .returncode != 0 :
1616 print ('failed to run above command, got exit code: %d' , process .returncode )
17- print ('stderr: %s' , process .stderr .strip ())
17+ print ('stderr: ' + process .stderr .strip ())
1818 exit (process .returncode )
1919
2020 output = process .stdout .strip ()
21- print ('# %s' , output )
21+ print ('# ' + output )
2222 return output
2323
2424
2525def find_and_replace_regex_in_file (file_path : str , find_regex : str ,
2626 replace : str ):
2727
28- print ('Performing find and replace on "%s ": s/%s/%s' , file_path , find_regex , replace )
28+ print (f 'Performing find and replace on "{ file_path } ": s/{ find_regex } / { replace } ' )
2929 # Read in the file
3030 with open (file_path , 'r' ) as file :
3131 filedata = file .read ()
@@ -81,7 +81,7 @@ def print_help():
8181])
8282
8383first_commit_hash = cmd (['git' , 'rev-parse' , 'HEAD' ])
84- print ('First commit hash: %s' , first_commit_hash )
84+ print ('First commit hash: ' + first_commit_hash )
8585
8686find_and_replace_regex_in_file (
8787 '.github/workflows/osv-scanner-reusable.yml' ,
@@ -101,7 +101,7 @@ def print_help():
101101])
102102
103103second_commit_hash = cmd (['git' , 'rev-parse' , 'HEAD' ])
104- print ('Second commit hash: %s' , second_commit_hash )
104+ print ('Second commit hash: ' + second_commit_hash )
105105
106106find_and_replace_regex_in_file (
107107 '.github/workflows/osv-scanner-unified-workflow.yml' ,
0 commit comments