File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 44import  re 
55import  sys 
66import  urllib .request 
7- from  datetime  import  datetime 
87
98
109def  parse_nightly_version (nightly_version ):
@@ -75,13 +74,20 @@ def get_commit_hash_for_nightly(date_str):
7574        # Check if the first line of commit message matches 
7675        first_line  =  commit_msg .split ("\n " )[0 ].strip ()
7776        if  first_line  ==  target_title  or  first_line .startswith (f"{ date_str }   nightly" ):
78-             return  commit [ "sha" ] 
77+             return  extract_hash_from_title ( first_line ) 
7978
8079    raise  ValueError (
8180        f"Could not find commit with title matching '{ target_title }  ' in nightly branch" 
8281    )
8382
8483
84+ def  extract_hash_from_title (title ):
85+     match  =  re .search (r"\(([0-9a-fA-F]{7,40})\)" , title )
86+     if  not  match :
87+         raise  ValueError (f"Could not extract commit hash from title '{ title }  '" )
88+     return  match .group (1 )
89+ 
90+ 
8591def  update_pytorch_pin (commit_hash ):
8692    """ 
8793    Update .ci/docker/ci_commit_pins/pytorch.txt with the new commit hash. 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments