Skip to content

Commit

Permalink
[Typing] Skip coverage check if title has typing (#65058)
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo authored Jun 12, 2024
1 parent 1f56f89 commit ac45983
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions tools/get_pr_title.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@

import json
import os
import re
import sys

import requests

SKIP_COVERAGE_CHECKING_LABELS = [
"cinn",
"typing",
]

SKIP_COVERAGE_CHECKING_REGEX = re.compile(
rf"[\[【]({'|'.join(SKIP_COVERAGE_CHECKING_LABELS)})[\]】]",
re.IGNORECASE,
)


pr_id = os.getenv('GIT_PR_ID')
if not pr_id:
print('PREC No PR ID')
Expand All @@ -32,9 +44,10 @@

title = data['title']

prefixes = ['【CINN】', '[CINN]', '[cinn]', '【cinn】']
if any(title.startswith(prefix) for prefix in prefixes):
print('The title starts with cinn')
if match_obj := SKIP_COVERAGE_CHECKING_REGEX.search(title):
print(f'The title starts with {match_obj.group(0)}')
else:
print('The title does not start with cinn')
print(
f'The title does not start with {" or ".join(SKIP_COVERAGE_CHECKING_LABELS)}'
)
sys.exit(1)

0 comments on commit ac45983

Please sign in to comment.