@@ -739,18 +739,35 @@ def add_path(self, path: str, gpu: str = None):
739
739
title = f"🤗 Results of the { ci_event } tests."
740
740
# Add PR title with a link for push CI
741
741
ci_title = os .environ .get ("CI_TITLE" )
742
- commit_url = os .environ .get ("CI_COMMIT_URL" )
742
+ ci_url = os .environ .get ("CI_COMMIT_URL" )
743
+
744
+ commit_number = ci_url .split ("/" )[- 1 ]
745
+ ci_detail_url = f"https://api.github.com/repos/huggingface/transformers/commits/{ commit_number } "
746
+ ci_details = requests .get (ci_detail_url ).json ()
747
+ ci_author = ci_details ["author" ]["login" ]
748
+
743
749
if ci_title is not None :
744
- assert commit_url is not None
750
+ assert ci_url is not None
745
751
ci_title = ci_title .strip ().split ("\n " )[0 ].strip ()
746
752
753
+ merged_by = None
747
754
# Find the PR number (if any) and change the url to the actual PR page.
748
755
numbers = pr_number_re .findall (ci_title )
749
756
if len (numbers ) > 0 :
750
757
pr_number = numbers [0 ]
751
- commit_url = f"https://github.com/huggingface/transformers/pull/{ pr_number } "
758
+ ci_detail_url = f"https://api.github.com/repos/huggingface/transformers/pulls/{ pr_number } "
759
+ ci_details = requests .get (ci_detail_url ).json ()
760
+
761
+ ci_author = ci_details ["user" ]["login" ]
762
+ ci_url = f"https://github.com/huggingface/transformers/pull/{ pr_number } "
763
+
764
+ merged_by = ci_details ["merged_by" ]["login" ]
765
+
766
+ if merged_by is None :
767
+ ci_title = f"<{ ci_url } |{ ci_title } >\n Author: { ci_author } "
768
+ else :
769
+ ci_title = f"<{ ci_url } |{ ci_title } >\n Author: { ci_author } | Merged by: { merged_by } "
752
770
753
- ci_title = f"<{ commit_url } |{ ci_title } >"
754
771
else :
755
772
ci_title = ""
756
773
0 commit comments