mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 10:12:23 +06:00
Fix ci_url might be None (#17332)
* fix * Update utils/notification_service.py Co-authored-by: Lysandre Debut <lysandre.debut@reseau.eseo.fr> Co-authored-by: ydshieh <ydshieh@users.noreply.github.com> Co-authored-by: Lysandre Debut <lysandre.debut@reseau.eseo.fr>
This commit is contained in:
parent
6aad3872ce
commit
1b20c970a2
@ -741,15 +741,16 @@ if __name__ == "__main__":
|
||||
ci_title = os.environ.get("CI_TITLE")
|
||||
ci_url = os.environ.get("CI_COMMIT_URL")
|
||||
|
||||
commit_number = ci_url.split("/")[-1]
|
||||
ci_detail_url = f"https://api.github.com/repos/huggingface/transformers/commits/{commit_number}"
|
||||
ci_details = requests.get(ci_detail_url).json()
|
||||
ci_author = ci_details["author"]["login"]
|
||||
|
||||
if ci_title is not None:
|
||||
assert ci_url is not None
|
||||
ci_title = ci_title.strip().split("\n")[0].strip()
|
||||
|
||||
# Retrieve the PR title and author login to complete the report
|
||||
commit_number = ci_url.split("/")[-1]
|
||||
ci_detail_url = f"https://api.github.com/repos/huggingface/transformers/commits/{commit_number}"
|
||||
ci_details = requests.get(ci_detail_url).json()
|
||||
ci_author = ci_details["author"]["login"]
|
||||
|
||||
merged_by = None
|
||||
# Find the PR number (if any) and change the url to the actual PR page.
|
||||
numbers = pr_number_re.findall(ci_title)
|
||||
|
Loading…
Reference in New Issue
Block a user