Skip to content

Commit

Permalink
{CI} Ignore title check result if edit history notes (Azure#21676)
Browse files Browse the repository at this point in the history
* Update check_pull_request.py

* Update check_pull_request.py

* Update check_pull_request.py

* Update check_pull_request.py
  • Loading branch information
wangzelin007 authored Mar 17, 2022
1 parent e976381 commit a8f3ed1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/ci/check_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,17 @@ def main():
def check_pull_request(title, body):
if title.startswith('['):
error_flag = regex_line(title)
is_edit_history_note = False
history_note_error_flag = False
for line in body:
if line.startswith('['):
error_flag = regex_line(line) or error_flag
# get component name in []
ref = re.findall(r'[\[](.*?)[\]]', line)
if ref and ref[0] not in ['Component Name 1', 'Component Name 2']:
is_edit_history_note = True
history_note_error_flag = regex_line(line) or history_note_error_flag
# If edit history notes, ignore title check result
error_flag = error_flag if not is_edit_history_note else history_note_error_flag
elif title.startswith('{'):
error_flag = False
else:
Expand Down

0 comments on commit a8f3ed1

Please sign in to comment.