File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,12 +53,18 @@ def main() -> int:
5353 break
5454 page += 1
5555 match = next ((item for item in existing if MARKER in (item .get ("body" ) or "" )), None )
56- if match :
57- request (f"{ base } /{ match ['id' ]} " , token , "PATCH" , {"body" : body })
58- print (f"Updated Diffly comment { match ['id' ]} " )
59- else :
60- created = request (base , token , "POST" , {"body" : body })
61- print (f"Created Diffly comment { created .get ('id' , 'unknown' )} " )
56+ try :
57+ if match :
58+ request (f"{ base } /{ match ['id' ]} " , token , "PATCH" , {"body" : body })
59+ print (f"Updated Diffly comment { match ['id' ]} " )
60+ else :
61+ created = request (base , token , "POST" , {"body" : body })
62+ print (f"Created Diffly comment { created .get ('id' , 'unknown' )} " )
63+ except SystemExit as e :
64+ if "404" in str (e ) and "GitHub API" in str (e ):
65+ print (f"Warning: Could not post comment due to 404 (possibly missing permissions for PR comments in this context): { e } " )
66+ else :
67+ raise
6268 return 0
6369
6470
You can’t perform that action at this time.
0 commit comments