mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
29 lines
899 B
Python
29 lines
899 B
Python
|
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||
|
# SPDX-License-Identifier: Apache-2.0
|
||
|
import os
|
||
|
import re
|
||
|
import sys
|
||
|
|
||
|
import yaml
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
description = os.getenv('CI_MERGE_REQUEST_DESCRIPTION', '')
|
||
|
if not description:
|
||
|
sys.exit(0)
|
||
|
pattern = r'^## Dynamic Pipeline Configuration(?:[^`]*?)```(?:\w+)(.*?)```'
|
||
|
result = re.search(pattern, description, re.DOTALL | re.MULTILINE)
|
||
|
if not result:
|
||
|
sys.exit(0)
|
||
|
|
||
|
data = yaml.safe_load(result.group(1))
|
||
|
raise_report_exit_code = False
|
||
|
with open('pipeline.env', 'a+') as f:
|
||
|
if 'Test Case Filters' in data:
|
||
|
raise_report_exit_code = True
|
||
|
test_case_filters = ' or '.join(data.get('Test Case Filters'))
|
||
|
f.write(f'TEST_CASE_FILTERS={test_case_filters}\n')
|
||
|
|
||
|
if raise_report_exit_code:
|
||
|
f.write('REPORT_EXIT_CODE=30\n')
|